ServiceAttribute

Trait ServiceAttribute 

Source
pub trait ServiceAttribute {
    // Required methods
    fn lifetime() -> ServiceScope;
    fn name() -> Option<String>;
    fn implements() -> Option<String>;
    fn is_default() -> bool;
}
Expand description

Attribute-based service registration

Required Methods§

Source

fn lifetime() -> ServiceScope

Get the configured lifetime

Source

fn name() -> Option<String>

Get the service name if specified

Source

fn implements() -> Option<String>

Get the interface this service implements

Source

fn is_default() -> bool

Check if this is the default implementation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§