pub struct ProcessId(/* private fields */);Expand description
A globally-unique id identifying a process.
The primary purpose of this id is to provide a globally-unique context within which
ThreadIds and SpanContexts are guaranteed to be unique. On a normal operating system
that is the process, on other systems it should be whatever is the closest equivalent, e.g. for
most embedded setups it should be unique for each time the system is restarted.
Implementations§
Source§impl ProcessId
impl ProcessId
Sourcepub fn random(rng: &mut impl Rng) -> Self
pub fn random(rng: &mut impl Rng) -> Self
Uses a random number generator to generate the ProcessId.
Sourcepub const fn from_raw(raw: u128) -> Self
pub const fn from_raw(raw: u128) -> Self
Creates a ProcessId from a raw value
Extra care needs to be taken that this is not a constant value or re-used in any way.
When possible prefer using ProcessId::random.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ProcessId
impl<'de> Deserialize<'de> for ProcessId
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for ProcessId
impl Ord for ProcessId
Source§impl PartialOrd for ProcessId
impl PartialOrd for ProcessId
impl Copy for ProcessId
impl Eq for ProcessId
impl StructuralPartialEq for ProcessId
Auto Trait Implementations§
impl Freeze for ProcessId
impl RefUnwindSafe for ProcessId
impl Send for ProcessId
impl Sync for ProcessId
impl Unpin for ProcessId
impl UnwindSafe for ProcessId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more