Trait shuttle::current::Tag

source ·
pub trait Tag: Taggable {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
👎Deprecated
Expand description

A Tag is an optional piece of metadata associated with a task (a thread or spawned future) to aid debugging.

It is automatically implemented for types which implement Taggable and are Any.

When set, the tag will be included in the Debug representation of TaskIds, which can help identify tasks in failing Shuttle tests. A task’s Tag can be set with the set_tag_for_current_task function. Newly spawned threads and futures inherit the tag of their parent at spawn time.

Required Methods§

source

fn as_any(&self) -> &dyn Any

👎Deprecated

Return the tag as Any, typically so that it can be downcast to a known concrete type

Implementors§

source§

impl<T> Tag for T
where T: Taggable + Any,