pub trait TryFromMultipart: Sized {
// Required method
fn try_from_multipart<'life0, 'async_trait>(
multipart: &'life0 mut Multipart
) -> Pin<Box<dyn Future<Output = Result<Self, TypedMultipartError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Types that can be created from an instance of Multipart.
Structs that implement this trait can be used as type parameters for TypedMultipart allowing to generate the supplied struct from the request data.
§Example
use axum_typed_multipart::TryFromMultipart;
#[derive(TryFromMultipart)]
struct Data {
name: String,
}
Required Methods§
fn try_from_multipart<'life0, 'async_trait>(
multipart: &'life0 mut Multipart
) -> Pin<Box<dyn Future<Output = Result<Self, TypedMultipartError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Object Safety§
This trait is not object safe.