Macro dilib::get_singleton_trait
source · [−]macro_rules! get_singleton_trait {
($container:ident, $trait_type:ident $(<$($generic:ident),+>)?) => { ... };
($container:ident, $trait_type:ident $(<$($generic:ident),+>)?, $name:literal) => { ... };
}Expand description
Helper macro to get the implementation of a trait in a Container as a singleton.
Usage
get_singleton_trait!(container, trait, name)
container: the container to get the implementation of the trait.trait: the trait to get the implementation from.name: optional name of the implementation.