[][src]Enum yukikaze::header::Filename

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

Filename parameter of Content-Disposition

Variants

Name(Option<String>)

Regular filename

Extended(Option<String>, String)

Extended filename*

Charset is always UTF-8, because whatelse you need?

Values:

  1. Optional language tag.
  2. Correctly percent encoded string

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(lang: Option<String>, name: String) -> Self[src]

Creates extended file name.

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

Returns whether filename is of extended type.

pub fn name(&self) -> Option<Cow<str>>[src]

Returns file name, percent decoded if necessary.

Note: expects to work with utf-8 only.

pub fn into_name(self) -> Option<String>[src]

Consumes self and returns file name, if present.

Note: expects to work with utf-8 only.

Trait Implementations

impl Debug for Filename[src]

Auto Trait Implementations

impl Sync for Filename

impl Send for Filename

impl Unpin for Filename

impl UnwindSafe for Filename

impl RefUnwindSafe for Filename

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self