pub fn id() -> Id
Available on crate feature
rt
and tokio_unstable
only.Expand description
Returns the Id
of the currently running task.
Panics
This function panics if called from outside a task. Please note that calls
to block_on
do not have task IDs, so the method will panic if called from
within a call to block_on
. For a version of this function that doesn’t
panic, see task::try_id()
.
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.