Skip to main content

compose

Function compose 

Source
pub fn compose(services: Vec<ContextService>) -> ContextService
Expand description

Compose a slice of ContextServices into a single ContextService that runs them in registration order. The composed service is BoxCloneSyncService, so cloning it is one Arc bump regardless of chain length. Each underlying service still requires a per-call clone (to satisfy &mut self), but the outer container is shared — so the per-request work scales with chain length only inside the Future, not at the boundary.