jsonrpc_http_server

Trait RequestMiddleware

Source
pub trait RequestMiddleware:
    Send
    + Sync
    + 'static {
    // Required method
    fn on_request(&self, request: Request<Body>) -> RequestMiddlewareAction;
}
Expand description

Allows to intercept request and handle it differently.

Required Methods§

Source

fn on_request(&self, request: Request<Body>) -> RequestMiddlewareAction

Takes a request and decides how to proceed with it.

Implementors§

Source§

impl<F> RequestMiddleware for F
where F: Fn(Request<Body>) -> RequestMiddlewareAction + Sync + Send + 'static,