pub struct MultipartForm<T>(pub T);
Expand description

Multipart data extractor (multipart/form-data).

Can be used to extract multipart data from the request body.

MultipartFormConfig allows you to configure extraction process.

Example

First define a structure to represent the form that implements FromMultipart traits. Then use the extractor in your route.

#[derive(FromMultipart)]
struct Upload {
   description: String,
   image: MultipartFile,
}
use std::io::Read;

async fn route(form: MultipartForm<Upload>) -> impl Responder {
    format!("Received image of size: {}", form.image.size)
}

Tuple Fields

0: T

Implementations

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

The associated error which can be returned.

Future that resolves to a Self

Configuration for this extractor

Convert request to a Self

Convert request to a Self Read more

Create and configure config instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more