pub struct MiddlewareBuilder { /* private fields */ }Expand description
Builder for creating middleware stacks.
Implementations§
Source§impl MiddlewareBuilder
impl MiddlewareBuilder
Sourcepub fn with<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn with<M: Middleware + 'static>(self, middleware: M) -> Self
Add middleware.
Sourcepub fn with_if<M: Middleware + 'static>(
self,
condition: bool,
middleware: M,
) -> Self
pub fn with_if<M: Middleware + 'static>( self, condition: bool, middleware: M, ) -> Self
Add middleware conditionally.
Sourcepub fn build(self) -> MiddlewareChain
pub fn build(self) -> MiddlewareChain
Build the middleware chain.
Sourcepub fn build_stack(self) -> MiddlewareStack
pub fn build_stack(self) -> MiddlewareStack
Build into a stack.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MiddlewareBuilder
impl !RefUnwindSafe for MiddlewareBuilder
impl Send for MiddlewareBuilder
impl Sync for MiddlewareBuilder
impl Unpin for MiddlewareBuilder
impl !UnwindSafe for MiddlewareBuilder
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