Struct grafix_toolbox::uses::sync::thread::ThreadId 1.19.0[−][src]
pub struct ThreadId(_);Expand description
A unique identifier for a running thread.
A ThreadId is an opaque object that has a unique value for each thread
that creates one. ThreadIds are not guaranteed to correspond to a thread’s
system-designated identifier. A ThreadId can be retrieved from the id
method on a Thread.
Examples
use std::thread;
let other_thread = thread::spawn(|| {
thread::current().id()
});
let other_thread_id = other_thread.join().unwrap();
assert!(thread::current().id() != other_thread_id);Implementations
🔬 This is a nightly-only experimental API. (thread_id_value)
thread_id_value)This returns a numeric identifier for the thread identified by this
ThreadId.
As noted in the documentation for the type itself, it is essentially an opaque ID, but is guaranteed to be unique for each thread. The returned value is entirely opaque – only equality testing is stable. Note that it is not guaranteed which values new threads will return, and this may change across Rust versions.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ThreadId
impl UnwindSafe for ThreadId
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.