[][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

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

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

pub fn is_text(&self) -> bool[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.

pub fn next_entry(self) -> ReadEntryResult<M>[src]

Read the next entry in the request.

pub fn next_entry_inplace(&mut self) -> Result<Option<&mut Self>> where
    &'a mut M: ReadEntry
[src]

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> RefUnwindSafe for MultipartField<M> where
    M: RefUnwindSafe
[src]

impl<M> Send for MultipartField<M> where
    M: Send
[src]

impl<M> Sync for MultipartField<M> where
    M: Sync
[src]

impl<M> Unpin for MultipartField<M> where
    M: Unpin
[src]

impl<M> UnwindSafe for MultipartField<M> where
    M: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,