Enum actix_web::http::header::DispositionParam [−][src]
pub enum DispositionParam {
Name(String),
Filename(String),
FilenameExt(ExtendedValue),
Unknown(String, String),
UnknownExt(String, ExtendedValue),
}
Expand description
Parameter in ContentDisposition
.
Examples
use actix_http::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)
Tuple Fields
0: String
For DispositionType::FormData
(i.e. multipart/form-data), the name of an field from
the form.
Filename(String)
Tuple Fields
0: 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)
Tuple Fields
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 parameter as defined in RFC5987 as ext-parameter, in RFC6266 as ext-token “=” ext-value. The single trailing asterisk is not included. Recipients should ignore unrecognizable parameters.
Implementations
Returns true
if the parameter is Filename
.
Returns true
if the parameter is FilenameExt
.
Returns true
if the parameter is Unknown
and the name
matches.
Returns true
if the parameter is UnknownExt
and the
name
matches.
Returns the filename if applicable.
Returns the filename* if applicable.
Returns the value of the unrecognized regular parameter if it is
Unknown
and the name
matches.
Returns the value of the unrecognized extended parameter if it is
Unknown
and the name
matches.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for DispositionParam
impl Send for DispositionParam
impl Sync for DispositionParam
impl Unpin for DispositionParam
impl UnwindSafe for DispositionParam
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more