Function gotham::pipeline::single_pipeline
source · pub fn single_pipeline<C>(
c: Pipeline<C>
) -> (SinglePipelineChain<C>, SinglePipelineSet<C>)where
C: NewMiddlewareChain,
Expand description
Creates a single pipeline for use in applications with straightforward use cases for middleware.
Returns instances of the required PipelineHandleChain and PipelineSet types ready for use with
build_router
.
Examples
let (chain, pipelines) = single_pipeline(
new_pipeline()
.add(NewSessionMiddleware::default().with_session_type::<Session>())
.build(),
);
build_router(chain, pipelines, |route| {
// Implementation elided
});