pub struct MiddlewarePipelineV2 { /* private fields */ }
Expand description
Middleware pipeline for the new system
Implementations§
Source§impl MiddlewarePipelineV2
impl MiddlewarePipelineV2
Sourcepub fn debug_info(&self) -> PipelineInfo
pub fn debug_info(&self) -> PipelineInfo
Get debug information about the pipeline
Sourcepub fn with_debug(self) -> DebugPipeline
pub fn with_debug(self) -> DebugPipeline
Create a debug pipeline that wraps each middleware with timing
Source§impl MiddlewarePipelineV2
impl MiddlewarePipelineV2
Sourcepub fn add<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn add<M: Middleware + 'static>(self, middleware: M) -> Self
Add middleware to the pipeline
Sourcepub fn add_mut<M: Middleware + 'static>(&mut self, middleware: M)
pub fn add_mut<M: Middleware + 'static>(&mut self, middleware: M)
Add middleware to the pipeline (mutable version)
Sourcepub fn from_middleware_vec(middleware: Vec<Arc<dyn Middleware>>) -> Self
pub fn from_middleware_vec(middleware: Vec<Arc<dyn Middleware>>) -> Self
Create a pipeline from a vector of Arc
Sourcepub fn add_boxed(self, middleware: Arc<dyn Middleware>) -> Self
pub fn add_boxed(self, middleware: Arc<dyn Middleware>) -> Self
Add an already-boxed middleware to the pipeline
Sourcepub fn extend(self, other: Self) -> Self
pub fn extend(self, other: Self) -> Self
Extend this pipeline with middleware from another pipeline The middleware from this pipeline will execute before the middleware from the other pipeline
Sourcepub async fn execute<F, Fut>(
&self,
request: ElifRequest,
handler: F,
) -> ElifResponsewhere
F: FnOnce(ElifRequest) -> Fut + Send + 'static,
Fut: Future<Output = ElifResponse> + Send + 'static,
pub async fn execute<F, Fut>(
&self,
request: ElifRequest,
handler: F,
) -> ElifResponsewhere
F: FnOnce(ElifRequest) -> Fut + Send + 'static,
Fut: Future<Output = ElifResponse> + Send + 'static,
Execute the middleware pipeline with a handler
Trait Implementations§
Source§impl Clone for MiddlewarePipelineV2
impl Clone for MiddlewarePipelineV2
Source§impl Debug for MiddlewarePipelineV2
impl Debug for MiddlewarePipelineV2
Source§impl Default for MiddlewarePipelineV2
impl Default for MiddlewarePipelineV2
Source§impl From<Vec<Arc<dyn Middleware>>> for MiddlewarePipelineV2
impl From<Vec<Arc<dyn Middleware>>> for MiddlewarePipelineV2
Auto Trait Implementations§
impl Freeze for MiddlewarePipelineV2
impl !RefUnwindSafe for MiddlewarePipelineV2
impl Send for MiddlewarePipelineV2
impl Sync for MiddlewarePipelineV2
impl Unpin for MiddlewarePipelineV2
impl !UnwindSafe for MiddlewarePipelineV2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more