Function try_id

pub fn try_id() -> Option<Id> 
Available on crate features dep_tokio and std only.
Expand description

Returns the Id of the currently running task, or None if called outside of a task.

This function is similar to task::id(), except that it returns None rather than panicking if called outside of a task context.