pub struct Map { /* private fields */ }
Expand description
Map created during parsing.
Implementations
sourceimpl Map
impl Map
sourcepub fn iter(&self) -> impl Iterator<Item = Field<'_>> + Send + Sync
pub fn iter(&self) -> impl Iterator<Item = Field<'_>> + Send + Sync
Creates an iterator over the map.
Returns references to Field
s.
Examples
use sequoia_openpgp as openpgp;
use openpgp::parse::{Parse, PacketParserBuilder};
let message_data = b"\xcb\x12t\x00\x00\x00\x00\x00Hello world.";
let pp = PacketParserBuilder::from_bytes(message_data)?
.map(true) // Enable mapping.
.buffer_unread_content() // For the packet body.
.build()?
.expect("One packet, not EOF");
let map = pp.map().expect("Mapping is enabled");
assert_eq!(map.iter().count(), 6);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
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