Skip to main content

FromRequest

Trait FromRequest 

Source
pub trait FromRequest: Sized + Send {
    const BACKGROUND_TASKS: bool = false;

    // Required method
    fn from_request(
        req: Request,
    ) -> impl Future<Output = Result<Self, ApiError>> + Send;

    // Provided method
    fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry) { ... }
}
Expand description

Extract a value from the whole request, possibly consuming the body.

Provided Associated Constants§

Source

const BACKGROUND_TASKS: bool = false

Whether extraction needs a request-owned background queue.

Required Methods§

Source

fn from_request( req: Request, ) -> impl Future<Output = Result<Self, ApiError>> + Send

Perform the extraction.

Provided Methods§

Source

fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry)

Document this extractor on op (request body, …).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§