Type Alias ArcMakeService

Source
pub type ArcMakeService<S, E> = Arc<dyn MakeService<Service = S, Error = E> + Send + Sync + 'static>;
Expand description

ArcMakeService<S, E> is similar to BoxedMakeService<S, E>, but uses Arc instead of Box. This allows for multiple owners of the same MakeService implementation, enabling efficient cloning and sharing across multiple components or threads.

§Key Features

  • Shared Ownership: Allows multiple components to share the same MakeService instance.
  • Type Erasure: Enables storing different MakeService implementations uniformly.
  • Efficient Cloning: Arc allows for cheap cloning of the service factory reference.

This type is particularly useful in scenarios where a service factory needs to be shared across multiple parts of an application, such as in worker pools.

Aliased Type§

pub struct ArcMakeService<S, E> { /* private fields */ }