Enum ruma::http_headers::ContentDispositionType
source · #[non_exhaustive]pub enum ContentDispositionType {
Inline,
Attachment,
}
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
§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<TokenString> for ContentDispositionType
impl PartialEq<TokenString> for ContentDispositionType
source§fn eq(&self, other: &TokenString) -> bool
fn eq(&self, other: &TokenString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for ContentDispositionType
impl PartialEq for ContentDispositionType
source§fn eq(&self, other: &ContentDispositionType) -> bool
fn eq(&self, other: &ContentDispositionType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ContentDispositionType
impl PartialOrd for ContentDispositionType
source§fn partial_cmp(&self, other: &ContentDispositionType) -> Option<Ordering>
fn partial_cmp(&self, other: &ContentDispositionType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> TryFrom<&'a [u8]> for ContentDispositionType
impl<'a> TryFrom<&'a [u8]> for ContentDispositionType
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.