Macro task_local
macro_rules! task_local {
() => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty; $($rest:tt)*) => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty) => { ... };
}
Declares a new task-local key of type tokio::task::LocalKey.
Syntax
The macro wraps any number of static declarations and makes them local to the current task. Publicity and attributes for each static is preserved. For example:
Examples
# use task_local;
task_local!
#
See LocalKey documentation for more
information.