pub trait FieldReader<'t>: Sized + Any {
    type Future: Future<Output = Result<Self, MultipartError>>;

    // Required method
    fn read_field(
        req: &'t HttpRequest,
        field: Field,
        limits: &'t mut Limits
    ) -> Self::Future;
}
Expand description

Trait that data types to be used in a multipart form struct should implement.

It represents an asynchronous handler that processes a multipart field to produce Self.

Required Associated Types§

source

type Future: Future<Output = Result<Self, MultipartError>>

Future that resolves to a Self.

Required Methods§

source

fn read_field( req: &'t HttpRequest, field: Field, limits: &'t mut Limits ) -> Self::Future

The form will call this function to handle the field.

Implementors§

source§

impl<'t> FieldReader<'t> for Bytes

§

type Future = Pin<Box<dyn Future<Output = Result<Bytes, MultipartError>> + 't, Global>>

source§

impl<'t> FieldReader<'t> for TempFile

Available on crate feature tempfile only.
§

type Future = Pin<Box<dyn Future<Output = Result<TempFile, MultipartError>> + 't, Global>>

source§

impl<'t, T> FieldReader<'t> for Json<T>where T: DeserializeOwned + 'static,

§

type Future = Pin<Box<dyn Future<Output = Result<Json<T>, MultipartError>> + 't, Global>>

source§

impl<'t, T> FieldReader<'t> for Text<T>where T: DeserializeOwned + 'static,

§

type Future = Pin<Box<dyn Future<Output = Result<Text<T>, MultipartError>> + 't, Global>>