[−][src]Enum sequoia_openpgp::parse::PacketParserResult
The return type of PacketParser::next() and
PacketParser::recurse().
We don't use an Option, because when we reach the end of the
packet sequence, some information about the message needs to
remain accessible.
Variants
Some(PacketParser<'a>)A PacketParser for the next packet.
EOF(PacketParserEOF)Information about a fully parsed packet sequence.
Implementations
impl<'a> PacketParserResult<'a>[src]
pub fn is_none(&self) -> bool[src]
Like Option::is_none().
pub fn is_eof(&self) -> bool[src]
An alias for is_none().
pub fn is_some(&self) -> bool[src]
Like Option::is_some().
pub fn expect(self, msg: &str) -> PacketParser<'a>[src]
Like Option::expect().
pub fn unwrap(self) -> PacketParser<'a>[src]
Like Option::unwrap().
pub fn as_ref(&self) -> Option<&PacketParser<'a>>[src]
Like Option::as_ref().
pub fn as_mut(&mut self) -> Option<&mut PacketParser<'a>>[src]
Like Option::as_mut().
pub fn take(&mut self) -> Self[src]
Like Option::take().
self is replaced with a PacketParserEOF with default
values.
pub fn map<U, F>(self, f: F) -> Option<U> where
F: FnOnce(PacketParser<'a>) -> U, [src]
F: FnOnce(PacketParser<'a>) -> U,
Like Option::map().
pub fn recursion_depth(&self) -> Option<isize>[src]
The current packet's recursion depth.
A top-level packet has a recursion depth of 0. Packets in a top-level container have a recursion depth of 1, etc.
Note: if the PacketParser has reached the end of the packet sequence and is not parsing a packet, then this returns None.
pub fn last_recursion_depth(&self) -> Option<isize>[src]
The last packet's recursion depth.
A top-level packet has a recursion depth of 0. Packets in a top-level container have a recursion depth of 1, etc.
Note: if no packet has been returned yet, this returns None.
Trait Implementations
impl<'a> Debug for PacketParserResult<'a>[src]
impl<'a> From<PacketParserResult<'a>> for CertParser<'a, IntoIter<Packet>>[src]
fn from(ppr: PacketParserResult<'a>) -> Self[src]
Initializes a CertParser from a PacketParser.
impl<'a> Parse<'a, PacketParserResult<'a>> for PacketParser<'a>[src]
fn from_reader<R: Read + 'a>(reader: R) -> Result<PacketParserResult<'a>>[src]
Starts parsing an OpenPGP message stored in a std::io::Read object.
This function returns a PacketParser for the first packet in
the stream.
fn from_file<P: AsRef<Path>>(path: P) -> Result<PacketParserResult<'a>>[src]
Starts parsing an OpenPGP message stored in a file named path.
This function returns a PacketParser for the first packet in
the stream.
fn from_bytes<D: AsRef<[u8]> + ?Sized>(
data: &'a D
) -> Result<PacketParserResult<'a>>[src]
data: &'a D
) -> Result<PacketParserResult<'a>>
Starts parsing an OpenPGP message stored in a buffer.
This function returns a PacketParser for the first packet in
the stream.
impl<'_> TryFrom<PacketParserResult<'_>> for Cert[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(ppr: PacketParserResult) -> Result<Self>[src]
Returns the Cert found in the packet stream.
If there are more packets after the Cert, e.g. because the
packet stream is a keyring, this function will return
Error::MalformedCert.
impl<'a> TryFrom<PacketParserResult<'a>> for PacketPile[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(ppr: PacketParserResult<'a>) -> Result<PacketPile>[src]
Reads all of the packets from a PacketParser, and turns them
into a message.
Note: this assumes that ppr points to a top-level packet.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PacketParserResult<'a>
impl<'a> !Send for PacketParserResult<'a>
impl<'a> !Sync for PacketParserResult<'a>
impl<'a> Unpin for PacketParserResult<'a>
impl<'a> !UnwindSafe for PacketParserResult<'a>
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>,