Macro lunatic::process_local
source · macro_rules! process_local { () => { ... }; ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => { ... }; ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }) => { ... }; ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => { ... }; ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => { ... }; }
Expand description
Declare a new process local storage of type ProcessLocal
.
Syntax
The macro wraps any number of static declarations and makes them process local. Publicity and attributes for each static are allowed. Example:
use std::cell::RefCell;
process_local! {
pub static FOO: RefCell<u32> = RefCell::new(1);
#[allow(unused)]
static BAR: RefCell<f32> = RefCell::new(1.0);
}
See ProcessLocal
documentation for more
information.