Enum jsonrpc_http_server::RequestMiddlewareAction[][src]

pub enum RequestMiddlewareAction {
    Proceed {
        should_continue_on_invalid_cors: bool,
        request: Request<Body>,
    },
    Respond {
        should_validate_hosts: bool,
        response: Pin<Box<dyn Future<Output = Result<Response<Body>>> + Send>>,
    },
}
Expand description

Action undertaken by a middleware.

Variants

Proceed

Proceed with standard RPC handling

Show fields

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.

Show fields

Fields of Respond

should_validate_hosts: bool

Should standard hosts validation be performed?

response: Pin<Box<dyn Future<Output = Result<Response<Body>>> + Send>>

a future for server response

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.