[][src]Struct sequoia_openpgp::Message

pub struct Message { /* fields omitted */ }

An OpenPGP message.

An OpenPGP message is a structured sequence of OpenPGP packets. Basically, it's an optionally encrypted, optionally signed literal data packet. The exact structure is defined in Section 11.3 of RFC 4880.

Methods

impl Message[src]

pub fn from_packet_pile(pile: PacketPile) -> Result<Self>[src]

Converts the PacketPile to a Message.

Converting a PacketPile to a Message doesn't change the packets; it asserts that the packet sequence is an optionally encrypted, optionally signed, optionally compressed literal data packet. The exact grammar is defined in Section 11.3 of RFC 4880.

Caveats: this function assumes that any still encrypted parts or still compressed parts are valid messages.

pub fn from_packets(packets: Vec<Packet>) -> Result<Self>[src]

Converts the vector of Packets to a Message.

See Message::from_packet_pile for more details.

pub fn from_reader<R: Read>(reader: R) -> Result<Self>[src]

Reads a Message from the specified reader.

See Message::from_packet_pile for more details.

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Reads a Message from the specified file.

See Message::from_packet_pile for more details.

pub fn from_bytes(buf: &[u8]) -> Result<Self>[src]

Reads a Message from buf.

See Message::from_packet_pile for more details.

pub fn to_packet_pile(self) -> PacketPile[src]

Converts the Message to a PacketPile.

pub fn body(&self) -> Option<&Literal>[src]

Returns the body of the message.

Returns None if no literal data packet is found. This happens if a SEIP container has not been decrypted.

Trait Implementations

impl Debug for Message[src]

Auto Trait Implementations

impl Send for Message

impl !Sync for Message

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.