[][src]Struct rocket_multipart_form_data::MultipartFormDataField

pub struct MultipartFormDataField<'a> {
    pub typ: MultipartFormDataType,
    pub field_name: &'a str,
    pub size_limit: u64,
    pub content_type: Option<Vec<Mime>>,
}

The guarder for fields.

Fields

typ: MultipartFormDataType

The type of this field.

field_name: &'a str

The name of this field.

size_limit: u64

The size limit for this field.

content_type: Option<Vec<Mime>>

To filter the content types. It supports stars.

Methods

impl<'a> MultipartFormDataField<'a>[src]

pub fn text(field_name: &'a str) -> MultipartFormDataField<'a>[src]

Create a text field, the default size_limit is 1 MiB.

pub fn bytes(field_name: &'a str) -> MultipartFormDataField<'a>[src]

Create a raw field, the default size_limit is 1 MiB.

pub fn raw(field_name: &'a str) -> MultipartFormDataField<'a>[src]

Create a raw field, the default size_limit is 1 MiB.

pub fn file(field_name: &'a str) -> MultipartFormDataField<'a>[src]

Create a file field, the default size_limit is 8 MiB.

pub fn size_limit(self, size_limit: u64) -> MultipartFormDataField<'a>[src]

Set the size_limit for this field.

pub fn content_type(
    self,
    content_type: Option<Mime>
) -> MultipartFormDataField<'a>
[src]

Add a content type filter for this field. This method can be used multiple times to use multiple content type filters.

pub fn content_type_by_string<S: AsRef<str>>(
    self,
    content_type: Option<S>
) -> Result<MultipartFormDataField<'a>, FromStrError>
[src]

Add a content type filter for this field. This method can be used multiple times to use multiple content type filters.

Trait Implementations

impl<'a> Eq for MultipartFormDataField<'a>[src]

impl<'a> Ord for MultipartFormDataField<'a>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Restrict a value to a certain interval. Read more

impl<'a> PartialEq<MultipartFormDataField<'a>> for MultipartFormDataField<'a>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<'a> Clone for MultipartFormDataField<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> PartialOrd<MultipartFormDataField<'a>> for MultipartFormDataField<'a>[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> Debug for MultipartFormDataField<'a>[src]

Auto Trait Implementations

impl<'a> Send for MultipartFormDataField<'a>

impl<'a> Sync for MultipartFormDataField<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> IntoCollection<T> for T

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any