pub enum DispositionParam {
    Name(String),
    Filename(String),
    FilenameExt(ExtendedValue),
    Unknown(StringString),
    UnknownExt(StringExtendedValue),
}
Expand description

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(StringString)

An unrecognized regular parameter as defined in RFC5987 as reg-parameter, in RFC6266 as token “=” value. Recipients should ignore unrecognizable parameters.

UnknownExt(StringExtendedValue)

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.

Implementations

Returns true if the paramater is Name.

Returns true if the paramater is Filename.

Returns true if the paramater is FilenameExt.

Returns true if the paramater is Unknown and the name matches.

Returns true if the paramater is UnknownExt and the name matches.

Returns the name if applicable.

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.