[][src]Trait splinter::service::ServiceFactory

pub trait ServiceFactory: Send {
    fn available_service_types(&self) -> &[String];
fn create(
        &self,
        service_id: String,
        service_type: &str,
        circuit_id: &str,
        args: HashMap<String, String>
    ) -> Result<Box<dyn Service>, FactoryCreateError>;
fn get_rest_endpoints(&self) -> Vec<ServiceEndpoint>; }

A ServiceFactory creates services.

Required methods

fn available_service_types(&self) -> &[String]

Return the available service types that this factory can create.

fn create(
    &self,
    service_id: String,
    service_type: &str,
    circuit_id: &str,
    args: HashMap<String, String>
) -> Result<Box<dyn Service>, FactoryCreateError>

Create a Service instance with the given ID, of the given type, the given circuit_id, with the given arguments.

fn get_rest_endpoints(&self) -> Vec<ServiceEndpoint>

Get the ServiceEndpoint definitions that represent the REST API resources provided by the services that this factory can create.

Loading content...

Implementors

Loading content...