#[non_exhaustive]pub enum ContentTransferEncoding {
SevenBit,
EightBit,
Binary,
QuotedPrintable,
Base64,
Other(String),
}Expand description
MIME content-transfer-encoding (RFC 2045 §6).
The five RFC-defined values are explicit variants; any other syntactically
valid mime-token (e.g. an x- extension) round-trips through Other.
§Casing
RFC 2045 §6.1 says encoding names are case-insensitive. Both the
known-variant parser and the Other branch normalize to ASCII
lowercase on construction, so equality and hashing through the
derived impls are case-insensitive automatically: Other("Base64")
is unreachable (parses to Base64 instead) and Other("X-MyEnc")
stores "x-myenc".
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.
Implementations§
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for ContentTransferEncoding
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for ContentTransferEncoding
Available on crate feature
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for ContentTransferEncoding
impl Clone for ContentTransferEncoding
Source§fn clone(&self) -> ContentTransferEncoding
fn clone(&self) -> ContentTransferEncoding
Returns a duplicate 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 ContentTransferEncoding
impl Debug for ContentTransferEncoding
Source§impl<'de> Deserialize<'de> for ContentTransferEncoding
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ContentTransferEncoding
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ContentTransferEncoding
impl Display for ContentTransferEncoding
Source§impl FromStr for ContentTransferEncoding
impl FromStr for ContentTransferEncoding
Source§impl Hash for ContentTransferEncoding
impl Hash for ContentTransferEncoding
Source§impl JsonSchema for ContentTransferEncoding
impl JsonSchema for ContentTransferEncoding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ContentTransferEncoding
impl PartialEq for ContentTransferEncoding
Source§impl Serialize for ContentTransferEncoding
Available on crate feature serde only.
impl Serialize for ContentTransferEncoding
Available on crate feature
serde only.Source§impl TryFrom<&str> for ContentTransferEncoding
impl TryFrom<&str> for ContentTransferEncoding
impl Eq for ContentTransferEncoding
impl StructuralPartialEq for ContentTransferEncoding
Auto Trait Implementations§
impl Freeze for ContentTransferEncoding
impl RefUnwindSafe for ContentTransferEncoding
impl Send for ContentTransferEncoding
impl Sync for ContentTransferEncoding
impl Unpin for ContentTransferEncoding
impl UnsafeUnpin for ContentTransferEncoding
impl UnwindSafe for ContentTransferEncoding
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