Macro singleton_token

Source
macro_rules! singleton_token {
    ($name:ident) => { ... };
    ($(#[$($attr:meta)*])* struct $name:ident;) => { ... };
    ($(#[$($attr:meta)*])* $vis:vis struct $name:ident;) => { ... };
}
Expand description

Generate a zero-sized singleton token type.

The generated type provides a new method, as well as a fallible try_new version. These methods ensure there is only a single instance of the singleton at a time; singleton can still be dropped and re-instantiated.