Trait saphir::Middleware[][src]

pub trait Middleware: Send + Sync {
    fn resolve(
        &self,
        req: &mut SyncRequest,
        res: &mut SyncResponse
    ) -> RequestContinuation; }

The trait a struct need to impl to be considered as a middleware

Required Methods

This method will be invoked if the request is targeting an included path, (as defined when "applying" the middleware to the stack) and doesn't match any exclusion. Returning RequestContinuation::Next will allow the request to continue through the stack, and returning RequestContinuation::None will cease the request processing, returning as response the modified res param.

Implementors