[][src]Enum jsonrpc_http_server::RequestMiddlewareAction

pub enum RequestMiddlewareAction {
    Proceed {
        should_continue_on_invalid_cors: bool,
        request: Request<Body>,
    },
    Respond {
        should_validate_hosts: bool,
        response: Box<dyn Future<Item = Response<Body>, Error = Error> + Send>,
    },
}

Action undertaken by a middleware.

Variants

Proceed

Proceed with standard RPC handling

Fields of Proceed

should_continue_on_invalid_cors: bool

Should the request be processed even if invalid CORS headers are detected? This allows for side effects to take place.

request: Request<Body>

The request object returned

Respond

Intercept the request and respond differently.

Fields of Respond

should_validate_hosts: bool

Should standard hosts validation be performed?

response: Box<dyn Future<Item = Response<Body>, Error = Error> + Send>

a future for server response

Trait Implementations

impl From<Request<Body>> for RequestMiddlewareAction[src]

impl From<Response<Body>> for RequestMiddlewareAction[src]

impl From<Response> for RequestMiddlewareAction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.