pub struct Id(_);
Available on crate feature
rt
and tokio_unstable
only.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.
Note: This is an unstable API. The public API of this type may break in 1.x releases. See the documentation on unstable features for details.
Trait Implementations
impl Copy for Id
impl Eq for Id
impl StructuralEq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more