Skip to main content

components

Macro components 

Source
macro_rules! components {
    ($($item:tt)*) => { ... };
}
Expand description

Macro to define multiple singleton dependencies

Supports both concrete types and trait implementations:

  • Concrete type: Type
  • Trait implementation: Trait: Implementation ALL IMPLEMENTATION TYPES MUST IMPLEMENT THE Injectable TRAIT

§Examples

components!(
    DatabaseService,
    Logger: FileLogger,
    CacheService
);