pub struct Composition<M> { /* private fields */ }Expand description
A blind, ordered assembly of middleware composed over Identity. It is itself a
Middleware, so applying it is just wrap.
It is deliberately blind: Composition::then accepts any Middleware through a
single generic operation and inspects nothing, and the type offers no method named for
an orchestration policy (retry, timeout, backoff, circuit, quota, rate-limit) — that
policy is a consumer or sibling concern, never a core convenience.
§Order
Middleware are applied outermost-first in the order added: the first middleware
added with then is the outermost and observes each execution
first; the executor is innermost. This mirrors the assembly convention of the
prior art the mechanism is distilled from.
Implementations§
Source§impl Composition<Identity>
impl Composition<Identity>
Source§impl<M> Composition<M>
impl<M> Composition<M>
Sourcepub fn then<N>(self, next: N) -> Composition<Stack<N, M>>
pub fn then<N>(self, next: N) -> Composition<Stack<N, M>>
Add a middleware to the composition. Blind: it accepts any Middleware and
inspects nothing. The first middleware added is outermost (observes each
execution first); the executor is innermost.
Trait Implementations§
Source§impl<M: Clone> Clone for Composition<M>
impl<M: Clone> Clone for Composition<M>
Source§fn clone(&self) -> Composition<M>
fn clone(&self) -> Composition<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more