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§
source§impl<'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§
source§impl<'a> Clone for MultipartFormDataField<'a>
impl<'a> Clone for MultipartFormDataField<'a>
source§fn clone(&self) -> MultipartFormDataField<'a>
fn clone(&self) -> MultipartFormDataField<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for MultipartFormDataField<'a>
impl<'a> Debug for MultipartFormDataField<'a>
source§impl<'a> Ord for MultipartFormDataField<'a>
impl<'a> Ord for MultipartFormDataField<'a>
source§impl<'a> PartialEq<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
impl<'a> PartialEq<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
source§impl<'a> PartialOrd<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
impl<'a> PartialOrd<MultipartFormDataField<'a>> for MultipartFormDataField<'a>
1.0.0 · source§fn 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§
§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,
source§impl<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,
source§fn 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.