pub struct Multipart { /* private fields */ }
Expand description

Multipart extractor

Meant to be used in functions to extract files from an http request

async fn receive_file(multipart: Multipart) -> Response {
    for file in multipart.files() {
        if let Some(filename) = &file.filename {
            log::info!("Found file {}, writing content", filename);
            // Do something with the file...
        }
    }
    Response::ok()
}

Implementations

Retrieves a file from the multipart request by its name in the form

Retrieves all files contained in the multipart as a vector

Trait Implementations

Extract function, constructs Self from the request

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.