[][src]Trait exonum::helpers::fabric::ServiceFactory

pub trait ServiceFactory: 'static {
    fn service_name(&self) -> &str;
fn make_service(&mut self, run_context: &Context) -> Box<dyn Service>; fn command(
        &mut self,
        command: CommandName
    ) -> Option<Box<dyn CommandExtension>> { ... } }

Factory for service creation.

Services should provide implementation of this trait.

Required methods

fn service_name(&self) -> &str

Returns name of the service.

fn make_service(&mut self, run_context: &Context) -> Box<dyn Service>

Creates a new service instance from the context returned by the Run command.

Loading content...

Provided methods

fn command(&mut self, command: CommandName) -> Option<Box<dyn CommandExtension>>

Returns CommandExtension for the specific CommandName.

Loading content...

Implementors

Loading content...