[][src]Struct multipart::server::MultipartField

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

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

Fields

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.

The field's data.

Methods

impl<M: ReadEntry> MultipartField<M>
[src]

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.

Read the next entry in the request.

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

impl<M: Debug + ReadEntry> Debug for MultipartField<M>
[src]

Auto Trait Implementations

impl<M> Send for MultipartField<M> where
    M: Send

impl<M> Sync for MultipartField<M> where
    M: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Typeable for T where
    T: Any

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> UnsafeAny for T where
    T: Any