Struct rouille::input::multipart::MultipartField[][src]

pub struct MultipartField<M> where
    M: ReadEntry
{ pub headers: FieldHeaders, pub data: MultipartData<M>, }
Expand description

A field in a multipart request with its associated headers and data.

Fields

headers: FieldHeaders

The headers for this field, including the name, filename, and content-type, if provided.

Warning: Values are Client-Provided

Everything in this struct are values from the client and should be considered untrustworthy. This crate makes no effort to validate or sanitize any client inputs.

data: MultipartData<M>

The field’s data.

Implementations

Returns true if this field has no content-type or the content-type is text/....

This typically means it can be read to a string, but it could still be using an unsupported character encoding, so decoding to String needs to ensure that the data is valid UTF-8.

Note also that the field contents may be too large to reasonably fit in memory. The .save() adapter can be used to enforce a size limit.

Detecting character encodings by any means is (currently) beyond the scope of this crate.

pub fn next_entry(self) -> ReadEntryResult<M, MultipartField<M>>

Read the next entry in the request.

pub fn next_entry_inplace(
    &mut self
) -> Result<Option<&mut MultipartField<M>>, Error> where
    &'a mut M: for<'a> ReadEntry

Update self as the next entry.

Returns Ok(Some(self)) if another entry was read, Ok(None) if the end of the body was reached, and Err(e) for any errors that occur.

Trait Implementations

Formats the value using the given formatter. Read more

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.

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.