pub enum DispositionParam {
Name(String),
Filename(String),
FilenameExt(ExtendedValue),
Unknown(String, String),
UnknownExt(String, ExtendedValue),
}Expand description
A parameter to the disposition type.
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.
It is not supposed to contain
any non-ASCII characters when used in a Content-Disposition HTTP response header, where
FilenameExt with charset UTF-8 may be used instead
in case there are Unicode characters in file names.
FilenameExt(ExtendedValue)
An extended file name. It must not exist for ContentType::Formdata according to
RFC 7578 §4.2.
Unknown(String, String)
An unrecognized regular parameter as defined in
RFC 5987 §3.2.1 as
reg-parameter, in
RFC 6266 §4.1 as
token "=" value. Recipients should ignore unrecognizable parameters.
UnknownExt(String, ExtendedValue)
An unrecognized extended parameter as defined in
RFC 5987 §3.2.1 as
ext-parameter, in
RFC 6266 §4.1 as
ext-token "=" ext-value. The single trailing asterisk is not included. Recipients should
ignore unrecognizable parameters.
Implementations§
Source§impl DispositionParam
impl DispositionParam
Sourcepub fn is_filename(&self) -> bool
pub fn is_filename(&self) -> bool
Returns true if the parameter is Filename.
Sourcepub fn is_filename_ext(&self) -> bool
pub fn is_filename_ext(&self) -> bool
Returns true if the parameter is FilenameExt.
Sourcepub fn is_unknown<T: AsRef<str>>(&self, name: T) -> bool
pub fn is_unknown<T: AsRef<str>>(&self, name: T) -> bool
Returns true if the parameter is Unknown and the name
matches.
Sourcepub fn is_unknown_ext<T: AsRef<str>>(&self, name: T) -> bool
pub fn is_unknown_ext<T: AsRef<str>>(&self, name: T) -> bool
Returns true if the parameter is UnknownExt and the
name matches.
Sourcepub fn as_filename(&self) -> Option<&str>
pub fn as_filename(&self) -> Option<&str>
Returns the filename if applicable.
Sourcepub fn as_filename_ext(&self) -> Option<&ExtendedValue>
pub fn as_filename_ext(&self) -> Option<&ExtendedValue>
Returns the filename* if applicable.
Trait Implementations§
Source§impl Clone for DispositionParam
impl Clone for DispositionParam
Source§fn clone(&self) -> DispositionParam
fn clone(&self) -> DispositionParam
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more