Trait autowired::Component[][src]

pub trait Component: Any + 'static + Send + Sync {
    fn new_instance() -> Result<Arc<Self>, Box<dyn Error>>;

    fn register()
    where
        Self: Sized
, { ... }
fn after_register(&self) { ... } }

Required methods

fn new_instance() -> Result<Arc<Self>, Box<dyn Error>>[src]

create a new component instance

Loading content...

Provided methods

fn register() where
    Self: Sized
[src]

call new_instance to create new component, then add it into a global map

fn after_register(&self)[src]

run code after component register

Loading content...

Implementors

Loading content...