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>,
    },
}
Expand description

Action undertaken by a middleware.

Variants

Proceed

Fields

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

Proceed with standard RPC handling

Respond

Fields

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

Intercept the request and respond differently.

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.