Trait shaku::HasProvider[][src]

pub trait HasProvider<I: ?Sized>: ModuleInterface {
    fn provide(&self) -> Result<Box<I>, Box<dyn Error>>;
}

Indicates that a module contains a provider which implements the interface.

Required methods

fn provide(&self) -> Result<Box<I>, Box<dyn Error>>[src]

Create a service using the provider registered with the interface I. Each call will create a new instance of the service.

Examples

let foo: Box<dyn Foo> = module.provide().unwrap();
Loading content...

Implementors

Loading content...