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
impl<'a> Eq for RawPacket<'a>
impl<'a> StructuralEq for RawPacket<'a>
impl<'a> StructuralPartialEq for RawPacket<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more