pub struct MultipartFormDataField<'a> {
pub typ: MultipartFormDataType,
pub field_name: &'a str,
pub size_limit: u64,
pub content_type: Option<Vec<Mime>>,
}
Expand description
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.
Implementations
sourceimpl<'a> MultipartFormDataField<'a>
impl<'a> MultipartFormDataField<'a>
sourcepub fn text(field_name: &'a str) -> MultipartFormDataField<'a>
pub fn text(field_name: &'a str) -> MultipartFormDataField<'a>
Create a text field, the default size_limit is 1 MiB.
sourcepub fn bytes(field_name: &'a str) -> MultipartFormDataField<'a>
pub fn bytes(field_name: &'a str) -> MultipartFormDataField<'a>
Create a raw field, the default size_limit is 1 MiB.
sourcepub fn raw(field_name: &'a str) -> MultipartFormDataField<'a>
pub fn raw(field_name: &'a str) -> MultipartFormDataField<'a>
Create a raw field, the default size_limit is 1 MiB.
sourcepub fn file(field_name: &'a str) -> MultipartFormDataField<'a>
pub fn file(field_name: &'a str) -> MultipartFormDataField<'a>
Create a file field, the default size_limit is 8 MiB.
sourcepub fn size_limit(self, size_limit: u64) -> MultipartFormDataField<'a>
pub fn size_limit(self, size_limit: u64) -> MultipartFormDataField<'a>
Set the size_limit for this field.
sourcepub fn content_type(
self,
content_type: Option<Mime>
) -> MultipartFormDataField<'a>
pub fn content_type(
self,
content_type: Option<Mime>
) -> MultipartFormDataField<'a>
Add a content type filter for this field. This method can be used multiple times to use multiple content type filters.
sourcepub fn content_type_by_string<S: AsRef<str>>(
self,
content_type: Option<S>
) -> Result<MultipartFormDataField<'a>, FromStrError>
pub fn content_type_by_string<S: AsRef<str>>(
self,
content_type: Option<S>
) -> Result<MultipartFormDataField<'a>, FromStrError>
Add a content type filter for this field. This method can be used multiple times to use multiple content type filters.
Trait Implementations
sourceimpl<'a> Clone for MultipartFormDataField<'a>
impl<'a> Clone for MultipartFormDataField<'a>
sourcefn clone(&self) -> MultipartFormDataField<'a>
fn clone(&self) -> MultipartFormDataField<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for MultipartFormDataField<'a>
impl<'a> Debug for MultipartFormDataField<'a>
sourceimpl<'a> Ord for MultipartFormDataField<'a>
impl<'a> Ord for MultipartFormDataField<'a>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a> PartialEq<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
impl<'a> PartialEq<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
sourceimpl<'a> PartialOrd<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
impl<'a> PartialOrd<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for MultipartFormDataField<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for MultipartFormDataField<'a>
impl<'a> Send for MultipartFormDataField<'a>
impl<'a> Sync for MultipartFormDataField<'a>
impl<'a> Unpin for MultipartFormDataField<'a>
impl<'a> UnwindSafe for MultipartFormDataField<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CloneAny for Twhere
T: Any + Clone,
impl<T> CloneAny for Twhere
T: Any + Clone,
fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global>where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global>where
T: Sync,
fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + Sync + Send + 'static, Global>where
T: Send + Sync,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.