pub struct Id(pub(crate) NonZeroU64);
Expand description
An opaque ID that uniquely identifies a task relative to all other currently running tasks.
§Notes
- Task IDs are unique relative to other currently running tasks. When a task completes, the same ID may be used for another task.
- Task IDs are not sequential, and do not indicate the order in which tasks are spawned, what runtime a task is spawned on, or any other data.
- The task ID of the currently running task can be obtained from inside the
task via the
task::try_id()
andtask::id()
functions and from outside the task via theJoinHandle::id()
function.
Tuple Fields§
§0: NonZeroU64
Implementations§
Trait Implementations§
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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