Attribute Macro singleton

Source
#[singleton]
Available on crate feature singleton only.
Expand description

Generate a ctor static of this struct. By defeault, uses Default if the type implements it. You can pass an expression to the attribute to use it instead.

#[singleton] //using Default::default
#[singleton(MyType::parse)] //using MyType::parse
#[singleton(|| MyType::new())] //closures work too