ServiceFactory

Trait ServiceFactory 

Source
pub trait ServiceFactory:
    Send
    + Sync
    + 'static {
    type Service: Service;
    type Config;
    type Error: Error + Send + Sync + 'static;

    // Required method
    async fn create_service(
        &self,
        config: Self::Config,
    ) -> Result<Self::Service, Self::Error>;
}
Expand description

Factory trait for creating services

Required Associated Types§

Required Methods§

Source

async fn create_service( &self, config: Self::Config, ) -> Result<Self::Service, Self::Error>

Create a new service instance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§