[][src]Enum http_fs::headers::cd::Filename

pub enum Filename {
    Name(Option<String>),
    Extended(StringOption<String>, Vec<u8>),
}

Filename parameter of Content-Disposition

Variants

Name(Option<String>)

Regular filename

Extended(StringOption<String>, Vec<u8>)

Extended filename*

Values:

  1. Charset.
  2. Optional language tag.
  3. Raw bytes of name.

Methods

impl Filename[src]

pub fn new() -> Self[src]

Returns default Filename with empty name field.

pub fn with_name(name: String) -> Self[src]

Creates file name.

pub fn with_encoded_name(name: Cow<str>) -> Self[src]

Creates file name, and checks whether it should be encoded.

Note that actual encoding would happen only when header is written. The value itself would remain unchanged in the Filename.

pub fn with_extended(
    charset: String,
    lang: Option<String>,
    name: Vec<u8>
) -> Self
[src]

Creates extended file name.

pub fn is_extended(&self) -> bool[src]

Returns whether filename is of extended type.

Trait Implementations

impl Debug for Filename[src]

Auto Trait Implementations

impl Send for Filename

impl Sync for Filename

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]