[−][src]Enum actix_web::http::header::DispositionParam
Parameter in ContentDisposition
.
Examples
use actix_web::http::header::DispositionParam; let param = DispositionParam::Filename(String::from("sample.txt")); assert!(param.is_filename()); assert_eq!(param.as_filename().unwrap(), "sample.txt");
Variants
Name(String)
For DispositionType::FormData
(i.e. multipart/form-data), the name of an field from
the form.
Filename(String)
A plain file name.
FilenameExt(ExtendedValue)
An extended file name. It must not exist for ContentType::Formdata
according to
RFC7578 Section 4.2.
Unknown(String, String)
An unrecognized regular parameter as defined in RFC5987 as reg-parameter, in RFC6266 as token "=" value. Recipients should ignore unrecognizable parameters.
UnknownExt(String, ExtendedValue)
An unrecognized extended paramater as defined in RFC5987 as ext-parameter, in RFC6266 as ext-token "=" ext-value. The single trailling asterisk is not included. Recipients should ignore unrecognizable parameters.
Methods
impl DispositionParam
[src]
impl DispositionParam
pub fn is_name(&self) -> bool
[src]
pub fn is_name(&self) -> bool
Returns true
if the paramater is Name
.
pub fn is_filename(&self) -> bool
[src]
pub fn is_filename(&self) -> bool
Returns true
if the paramater is Filename
.
pub fn is_filename_ext(&self) -> bool
[src]
pub fn is_filename_ext(&self) -> bool
Returns true
if the paramater is FilenameExt
.
pub fn is_unknown<T: AsRef<str>>(&self, name: T) -> bool
[src]
pub fn is_unknown<T: AsRef<str>>(&self, name: T) -> bool
Returns true
if the paramater is Unknown
and the name
matches.
pub fn is_unknown_ext<T: AsRef<str>>(&self, name: T) -> bool
[src]
pub fn is_unknown_ext<T: AsRef<str>>(&self, name: T) -> bool
Returns true
if the paramater is UnknownExt
and the
name
matches.
pub fn as_name(&self) -> Option<&str>
[src]
pub fn as_name(&self) -> Option<&str>
Returns the name if applicable.
pub fn as_filename(&self) -> Option<&str>
[src]
pub fn as_filename(&self) -> Option<&str>
Returns the filename if applicable.
pub fn as_filename_ext(&self) -> Option<&ExtendedValue>
[src]
pub fn as_filename_ext(&self) -> Option<&ExtendedValue>
Returns the filename* if applicable.
pub fn as_unknown<T: AsRef<str>>(&self, name: T) -> Option<&str>
[src]
pub fn as_unknown<T: AsRef<str>>(&self, name: T) -> Option<&str>
Returns the value of the unrecognized regular parameter if it is
Unknown
and the name
matches.
pub fn as_unknown_ext<T: AsRef<str>>(&self, name: T) -> Option<&ExtendedValue>
[src]
pub fn as_unknown_ext<T: AsRef<str>>(&self, name: T) -> Option<&ExtendedValue>
Returns the value of the unrecognized extended parameter if it is
Unknown
and the name
matches.
Trait Implementations
impl PartialEq<DispositionParam> for DispositionParam
[src]
impl PartialEq<DispositionParam> for DispositionParam
fn eq(&self, other: &DispositionParam) -> bool
[src]
fn eq(&self, other: &DispositionParam) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DispositionParam) -> bool
[src]
fn ne(&self, other: &DispositionParam) -> bool
This method tests for !=
.
impl Clone for DispositionParam
[src]
impl Clone for DispositionParam
fn clone(&self) -> DispositionParam
[src]
fn clone(&self) -> DispositionParam
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Display for DispositionParam
[src]
impl Display for DispositionParam
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Debug for DispositionParam
[src]
impl Debug for DispositionParam
Auto Trait Implementations
impl Send for DispositionParam
impl Send for DispositionParam
impl Sync for DispositionParam
impl Sync for DispositionParam
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Erased for T
impl<T> Erased for T