pub trait FromRequest: Sized {
type Filter: Filter<Error = Rejection>;
// Required method
fn new() -> Self::Filter;
// Provided methods
fn is_body() -> bool { ... }
fn is_optional() -> bool { ... }
fn is_query() -> bool { ... }
fn content_type() -> &'static str { ... }
}Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn is_body() -> bool
fn is_body() -> bool
It’s true iff the type represents whole request body.
It returns true for Json<T> and Form<T>.
Sourcefn is_optional() -> bool
fn is_optional() -> bool
It’s true if the type is optional.
It returns true for Option<T>.
Sourcefn is_query() -> bool
fn is_query() -> bool
It’s true iff the type represents whole request query.
It returns true for Query<T>.
fn content_type() -> &'static str
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.