Struct gotham::pipeline::PipelineBuilder [−][src]
pub struct PipelineBuilder<T> where
T: NewMiddlewareChain, { /* fields omitted */ }
Expand description
Allows a pipeline to be defined by adding NewMiddleware
values, and building a Pipeline
.
Examples
new_pipeline()
.add(MiddlewareOne)
.add(MiddlewareTwo)
.add(MiddlewareThree)
.build();
The pipeline defined here is invoked in this order:
(&mut state)
→ MiddlewareOne
→ MiddlewareTwo
→ MiddlewareThree
→
handler
(provided later, when building the router)
Implementations
Builds a Pipeline
, which contains all middleware in the order provided via add
and is
ready to process requests via a NewHandler
provided to Pipeline::call
.
pub fn add<M>(self, m: M) -> PipelineBuilder<(M, T)> where
M: NewMiddleware,
M::Instance: Send + 'static,
Self: Sized,
pub fn add<M>(self, m: M) -> PipelineBuilder<(M, T)> where
M: NewMiddleware,
M::Instance: Send + 'static,
Self: Sized,
Adds a NewMiddleware
which will create a Middleware
during request dispatch.
Auto Trait Implementations
impl<T> RefUnwindSafe for PipelineBuilder<T>
impl<T> Send for PipelineBuilder<T> where
T: Send,
impl<T> Sync for PipelineBuilder<T> where
T: Sync,
impl<T> Unpin for PipelineBuilder<T> where
T: Unpin,
impl<T> UnwindSafe for PipelineBuilder<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more