macro_rules! singleton_token {
($vis: vis $id: ident) => { ... };
($($vis: vis $id: ident),*) => { ... };
}
Expand description
Produces tokens whose only identifier is their type, but is built such that only one instance of it can exist at any given time.
Looping on TokenTrait::new
with a singleton token to access a TokenCell
is equivalent to using a spin-lock.