Struct ProcessId
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§
§impl ProcessId
impl ProcessId
pub fn random(rng: &mut impl Rng) -> ProcessId
pub fn random(rng: &mut impl Rng) -> ProcessId
Uses a random number generator to generate the ProcessId.
pub const fn from_raw(raw: u128) -> ProcessId
pub const fn from_raw(raw: u128) -> ProcessId
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§
§impl<'de> Deserialize<'de> for ProcessId
impl<'de> Deserialize<'de> for ProcessId
§fn deserialize<D>(
deserializer: D,
) -> Result<ProcessId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ProcessId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for ProcessId
impl Ord for ProcessId
§impl PartialOrd for ProcessId
impl PartialOrd for ProcessId
§impl Serialize for ProcessId
impl Serialize for ProcessId
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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