#[non_exhaustive]pub enum ContentDispositionType {
Inline,
Attachment,
}
Available on (crate features
client-api-c
or client-api-s
) and (crate features client
or server
) and crate feature api
only.Expand description
A disposition type in the Content-Disposition
HTTP header as defined in Section 4.2 of RFC
6266.
This type can hold an arbitrary TokenString
. To build this with a custom value, convert it
from a TokenString
with ::from()
/ .into()
. To check for values that are not available as
a documented variant here, use its string representation, obtained through
.as_str()
.
Comparisons with other string types are done case-insensitively.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Inline
The content can be displayed.
This is the default.
Attachment
The content should be downloaded instead of displayed.
Implementations§
Source§impl ContentDispositionType
impl ContentDispositionType
Sourcepub fn parse(s: &str) -> Result<ContentDispositionType, TokenStringParseError>
pub fn parse(s: &str) -> Result<ContentDispositionType, TokenStringParseError>
Try parsing a &str
into a ContentDispositionType
.
Trait Implementations§
Source§impl AsRef<str> for ContentDispositionType
impl AsRef<str> for ContentDispositionType
Source§impl Clone for ContentDispositionType
impl Clone for ContentDispositionType
Source§fn clone(&self) -> ContentDispositionType
fn clone(&self) -> ContentDispositionType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContentDispositionType
impl Debug for ContentDispositionType
Source§impl Default for ContentDispositionType
impl Default for ContentDispositionType
Source§fn default() -> ContentDispositionType
fn default() -> ContentDispositionType
Returns the “default value” for a type. Read more
Source§impl Display for ContentDispositionType
impl Display for ContentDispositionType
Source§impl From<TokenString> for ContentDispositionType
impl From<TokenString> for ContentDispositionType
Source§fn from(value: TokenString) -> ContentDispositionType
fn from(value: TokenString) -> ContentDispositionType
Converts to this type from the input type.
Source§impl FromStr for ContentDispositionType
impl FromStr for ContentDispositionType
Source§type Err = TokenStringParseError
type Err = TokenStringParseError
The associated error which can be returned from parsing.
Source§fn from_str(
s: &str,
) -> Result<ContentDispositionType, <ContentDispositionType as FromStr>::Err>
fn from_str( s: &str, ) -> Result<ContentDispositionType, <ContentDispositionType as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl Ord for ContentDispositionType
impl Ord for ContentDispositionType
Source§fn cmp(&self, other: &ContentDispositionType) -> Ordering
fn cmp(&self, other: &ContentDispositionType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq<&'a str> for ContentDispositionType
impl<'a> PartialEq<&'a str> for ContentDispositionType
Source§impl PartialEq for ContentDispositionType
impl PartialEq for ContentDispositionType
Source§impl PartialOrd for ContentDispositionType
impl PartialOrd for ContentDispositionType
Source§impl<'a> TryFrom<&'a [u8]> for ContentDispositionType
impl<'a> TryFrom<&'a [u8]> for ContentDispositionType
Source§type Error = TokenStringParseError
type Error = TokenStringParseError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a [u8],
) -> Result<ContentDispositionType, <ContentDispositionType as TryFrom<&'a [u8]>>::Error>
fn try_from( value: &'a [u8], ) -> Result<ContentDispositionType, <ContentDispositionType as TryFrom<&'a [u8]>>::Error>
Performs the conversion.
impl Eq for ContentDispositionType
Auto Trait Implementations§
impl Freeze for ContentDispositionType
impl RefUnwindSafe for ContentDispositionType
impl Send for ContentDispositionType
impl Sync for ContentDispositionType
impl Unpin for ContentDispositionType
impl UnwindSafe for ContentDispositionType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.