[−][src]Struct sequoia_openpgp::Message
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 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.
Methods from Deref<Target = PacketPile>
pub fn pretty_print(&self)
[src]
Pretty prints the message to stderr.
This function is primarily intended for debugging purposes.
pub fn path_ref(&self, pathspec: &[usize]) -> Option<&Packet>
[src]
Returns a reference to the packet at the location described by
pathspec
.
pathspec
is a slice of the form [ 0, 1, 2 ]
. Each element
is the index of packet in a container. Thus, the previous
path specification means: return the third child of the second
child of the first top-level packet. In other words, the
starred packet in the following tree:
PacketPile
/ | \
0 1 2 ...
/ \
/ \
0 1 ...
/ | \ ...
0 1 2
*
And, [ 10 ]
means return the 11th top-level packet.
Note: there is no packet at the root. Thus, the path []
returns None.
ⓘImportant traits for Iter<'a>pub fn descendants(&self) -> Iter
[src]
Returns an iterator over all of the packet's descendants, in depth-first order.
pub fn children<'a>(&'a self) -> Iter<'a, Packet>
[src]
Returns an iterator over the top-level packets.
Trait Implementations
impl Debug for Message
[src]
impl Deref for Message
[src]
type Target = PacketPile
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl From<Message> for PacketPile
[src]
impl FromStr for Message
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<'a> Parse<'a, Message> for Message
[src]
fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>
[src]
Reads a Message
from the specified reader.
See Message::from_packet_pile
for more details.
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.
fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<Self>
[src]
Reads a Message
from buf
.
See Message::from_packet_pile
for more details.
impl PartialEq<Message> for Message
[src]
impl Serialize for Message
[src]
fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
Writes a serialized version of the specified Message
to o
.
fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl SerializeInto for Message
[src]
fn serialized_len(&self) -> usize
[src]
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl StructuralPartialEq for Message
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl !UnwindSafe for Message
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,