pub struct MiddlewareChain { /* private fields */ }Expand description
Middleware chain for processing requests
Implementations§
Source§impl MiddlewareChain
impl MiddlewareChain
Sourcepub fn add(&mut self, middleware: MiddlewareFn)
pub fn add(&mut self, middleware: MiddlewareFn)
Add middleware to the chain
Sourcepub fn process(&self, ctx: RequestContext) -> Result<RequestContext, McpError>
pub fn process(&self, ctx: RequestContext) -> Result<RequestContext, McpError>
Process request through middleware chain
Each middleware can:
- Modify the context and pass it to next middleware
- Return an error to short-circuit the chain
Trait Implementations§
Source§impl Clone for MiddlewareChain
impl Clone for MiddlewareChain
Source§fn clone(&self) -> MiddlewareChain
fn clone(&self) -> MiddlewareChain
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MiddlewareChain
impl !RefUnwindSafe for MiddlewareChain
impl Send for MiddlewareChain
impl Sync for MiddlewareChain
impl Unpin for MiddlewareChain
impl !UnwindSafe for MiddlewareChain
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