[][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>>,
    pub repetition: Repetition,
}

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.

repetition: Repetition

To define this MultipartFormDataField instance can be used how many times.

Implementations

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

pub fn text<S: ?Sized + AsRef<str>>(
    field_name: &S
) -> MultipartFormDataField<'_>
[src]

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

pub fn bytes<S: ?Sized + AsRef<str>>(
    field_name: &S
) -> MultipartFormDataField<'_>
[src]

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

pub fn raw<S: ?Sized + AsRef<str>>(field_name: &S) -> MultipartFormDataField<'_>[src]

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

pub fn file<S: ?Sized + AsRef<str>>(
    field_name: &S
) -> MultipartFormDataField<'_>
[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.

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

Set the repetition for this field.

Trait Implementations

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

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

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

impl<T> IntoCollection<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,