pub enum Filename {
Name(Option<String>),
Extended(Option<String>, String),
}
Expand description
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:
- Optional language tag.
- Correctly percent encoded string
Implementations§
Source§impl Filename
impl Filename
Sourcepub fn with_encoded_name(name: Cow<'_, str>) -> Self
pub fn with_encoded_name(name: Cow<'_, str>) -> Self
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
.
Sourcepub fn with_extended(lang: Option<String>, name: String) -> Self
pub fn with_extended(lang: Option<String>, name: String) -> Self
Creates extended file name.
Sourcepub fn is_extended(&self) -> bool
pub fn is_extended(&self) -> bool
Returns whether filename is of extended type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filename
impl RefUnwindSafe for Filename
impl Send for Filename
impl Sync for Filename
impl Unpin for Filename
impl UnwindSafe for Filename
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more