Trait nuts_container::ServiceFactory 
source · pub trait ServiceFactory<B: Backend> {
    type Service: Service<B>;
    type Err: From<Error<B>>;
    // Required methods
    fn create(container: Container<B>) -> Result<Self::Service, Self::Err>;
    fn open(container: Container<B>) -> Result<Self::Service, Self::Err>;
}Expand description
Factory used to instantiate a service.
Required Associated Types§
sourcetype Err: From<Error<B>>
 
type Err: From<Error<B>>
Error returned by Self::open and Self::create.
It must be possible to put an Error instance into this error.
Required Methods§
sourcefn create(container: Container<B>) -> Result<Self::Service, Self::Err>
 
fn create(container: Container<B>) -> Result<Self::Service, Self::Err>
Create a service instance.
Called by Container::create_service the method should create a new
Self::Service instance. The created container is
passed to this method.
sourcefn open(container: Container<B>) -> Result<Self::Service, Self::Err>
 
fn open(container: Container<B>) -> Result<Self::Service, Self::Err>
Open a service.
Called by Container::open_service the method should open an
existing Self::Service instance. The opened container
is passed to this method.
Object Safety§
This trait is not object safe.