pub trait PipelineHandleChain<P>: RefUnwindSafe {
// Required method
fn call<F>(
&self,
pipelines: &PipelineSet<P>,
state: State,
f: F,
) -> Pin<Box<HandlerFuture>>
where F: FnOnce(State) -> Pin<Box<HandlerFuture>> + Send + 'static;
}
Expand description
A heterogeneous list of Handle<P, _>
values, where P
is a pipeline type. The pipelines are
borrowed and invoked in order to serve a request.
Implemented using nested tuples, with ()
marking the end of the list. The list is in the
reverse order of their invocation when a request is dispatched.
That is:
(p3, (p2, (p1, ())))
will be invoked as:
(state, request)
→ p1
→ p2
→ p3
→ handler
Required Methods§
Sourcefn call<F>(
&self,
pipelines: &PipelineSet<P>,
state: State,
f: F,
) -> Pin<Box<HandlerFuture>>
fn call<F>( &self, pipelines: &PipelineSet<P>, state: State, f: F, ) -> Pin<Box<HandlerFuture>>
Invokes this part of the PipelineHandleChain
, with requests being passed through to f
once all Middleware
in the Pipeline
have passed the request through.
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.
Implementations on Foreign Types§
Source§impl<P> PipelineHandleChain<P> for ()
The marker for the end of a PipelineHandleChain
.
impl<P> PipelineHandleChain<P> for ()
The marker for the end of a PipelineHandleChain
.
fn call<F>( &self, _: &PipelineSet<P>, state: State, f: F, ) -> Pin<Box<HandlerFuture>>
Source§impl<P, T, N, U> PipelineHandleChain<P> for (Handle<Pipeline<T>, N>, U)where
T: NewMiddlewareChain,
T::Instance: Send + 'static,
U: PipelineHandleChain<P>,
P: Lookup<Pipeline<T>, N>,
N: RefUnwindSafe,
Part of a PipelineHandleChain
which references a Pipeline
and continues with a tail element.
impl<P, T, N, U> PipelineHandleChain<P> for (Handle<Pipeline<T>, N>, U)where
T: NewMiddlewareChain,
T::Instance: Send + 'static,
U: PipelineHandleChain<P>,
P: Lookup<Pipeline<T>, N>,
N: RefUnwindSafe,
Part of a PipelineHandleChain
which references a Pipeline
and continues with a tail element.