Enum sequoia_openpgp::types::DataFormat [−][src]
#[non_exhaustive] pub enum DataFormat { Binary, Text, Unicode, MIME, Unknown(char), }
Expand description
Describes the format of the body of a literal data packet.
See the description of literal data packets Section 5.9 of RFC 4880.
Note: This enum cannot be exhaustively matched to allow future extensions.
Examples
Construct a new Message
containing one text literal packet:
use sequoia_openpgp as openpgp; use std::convert::TryFrom; use openpgp::packet::prelude::*; use openpgp::types::DataFormat; use openpgp::message::Message; let mut packets = Vec::new(); let mut lit = Literal::new(DataFormat::Text); lit.set_body(b"data".to_vec()); packets.push(lit.into()); let message = Message::try_from(packets); assert!(message.is_ok(), "{:?}", message);
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Binary data.
This is a hint that the content is probably binary data.
Text data.
This is a hint that the content is probably text; the encoding is not specified.
Text data, probably valid UTF-8.
This is a hint that the content is probably UTF-8 encoded.
MIME message.
This is defined in Section 5.10 of RFC4880bis.
Unknown(char)
Unknown format specifier.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for DataFormat
impl Send for DataFormat
impl Sync for DataFormat
impl Unpin for DataFormat
impl UnwindSafe for DataFormat
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self