Trait HandlerArgument

Source
pub trait HandlerArgument: ShouldBeHandlerArgument {
    // Provided methods
    fn request_body(_gen: &mut SchemaGenerator) -> Option<RequestBody> { ... }
    fn parameters(_gen: &mut SchemaGenerator) -> Vec<Parameter> { ... }
}
Expand description

A type used as argument to a handler which can be described by a request body object or a parameter object

This type should be implemented by everything which implements FromRequest / FromRequestParts when using axum or [FromRequest] when using [actix]

Provided Methods§

Source

fn request_body(_gen: &mut SchemaGenerator) -> Option<RequestBody>

Get the request body object describing Self

Should return None if Self doesn’t consume the request body

Source

fn parameters(_gen: &mut SchemaGenerator) -> Vec<Parameter>

Get the parameter objects describing Self

Should return an empty Vec if Self doesn’t parse any parameters

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§