1.19.0[][src]Struct std::thread::ThreadId

pub struct ThreadId(_);

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.


use std::thread;

let other_thread = thread::spawn(|| {

let other_thread_id = other_thread.join().unwrap();
assert!(thread::current().id() != other_thread_id);Run

Trait Implementations

impl Clone for ThreadId[src]

impl Copy for ThreadId[src]

impl Debug for ThreadId[src]

impl Eq for ThreadId[src]

impl Hash for ThreadId[src]

impl PartialEq<ThreadId> for ThreadId[src]

impl StructuralEq for ThreadId[src]

impl StructuralPartialEq for ThreadId[src]

Auto Trait Implementations

impl RefUnwindSafe for ThreadId

impl Send for ThreadId

impl Sync for ThreadId

impl Unpin for ThreadId

impl UnwindSafe for ThreadId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.