Trait actix_multipart::form::MultipartCollect
source · pub trait MultipartCollect: Sized {
// Required methods
fn limit(field_name: &str) -> Option<usize>;
fn handle_field<'t>(
req: &'t HttpRequest,
field: Field,
limits: &'t mut Limits,
state: &'t mut State
) -> LocalBoxFuture<'t, Result<(), MultipartError>>;
fn from_state(state: State) -> Result<Self, MultipartError>;
}
Expand description
Trait that allows a type to be used in the MultipartForm
extractor.
You should use the MultipartForm
macro to derive this for your struct.
Required Methods§
sourcefn limit(field_name: &str) -> Option<usize>
fn limit(field_name: &str) -> Option<usize>
An optional limit in bytes to be applied a given field name. Note this limit will be shared across all fields sharing the same name.
sourcefn handle_field<'t>(
req: &'t HttpRequest,
field: Field,
limits: &'t mut Limits,
state: &'t mut State
) -> LocalBoxFuture<'t, Result<(), MultipartError>>
fn handle_field<'t>( req: &'t HttpRequest, field: Field, limits: &'t mut Limits, state: &'t mut State ) -> LocalBoxFuture<'t, Result<(), MultipartError>>
The extractor will call this function for each incoming field, the state can be updated with the processed field data.
sourcefn from_state(state: State) -> Result<Self, MultipartError>
fn from_state(state: State) -> Result<Self, MultipartError>
Once all the fields have been processed and stored in the state, this is called to convert into the struct representation.
Object Safety§
This trait is not object safe.