pub struct RawPacket<'a> { /* private fields */ }Expand description
A mostly unparsed Packet.
This is returned by RawCert::packets.
The data includes the OpenPGP framing (i.e., the CTB, and length
information). RawPacket::body returns just the bytes
corresponding to the packet’s body, i.e., without the OpenPGP
framing.
You can convert it to a Packet using TryFrom.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::packet::Packet;
use openpgp::packet::Tag;
for p in rawcert.packets() {
if p.tag() == Tag::SecretSubkey {
if let Ok(packet) = Packet::try_from(p) {
// Do something with the packet.
}
}
}Implementations§
Trait Implementations§
Source§impl<'a> Ord for RawPacket<'a>
impl<'a> Ord for RawPacket<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for RawPacket<'a>
impl<'a> PartialOrd for RawPacket<'a>
impl<'a> Eq for RawPacket<'a>
impl<'a> StructuralPartialEq for RawPacket<'a>
Auto Trait Implementations§
impl<'a> Freeze for RawPacket<'a>
impl<'a> RefUnwindSafe for RawPacket<'a>
impl<'a> Send for RawPacket<'a>
impl<'a> Sync for RawPacket<'a>
impl<'a> Unpin for RawPacket<'a>
impl<'a> UnwindSafe for RawPacket<'a>
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