pub struct MapEntries<'a> { /* private fields */ }Available on crate feature
cbor only.Expand description
A deterministic CBOR map stored as key/value slots, supporting efficient key-based extraction without rebuilding tree maps.
Implementations§
Source§impl<'a> MapEntries<'a>
impl<'a> MapEntries<'a>
Sourcepub fn new(entries: Vec<(i64, &'a [u8])>) -> Self
pub fn new(entries: Vec<(i64, &'a [u8])>) -> Self
Creates from entries that are already in CBOR deterministic key order
(as validated by decode_map_entries_slices_notrail). Skips re-sorting.
Sourcepub fn take(&mut self, key: i64) -> Option<&'a [u8]>
pub fn take(&mut self, key: i64) -> Option<&'a [u8]>
Removes and returns the raw value stored under the key, if still present.
Sourcepub fn contains(&self, key: i64) -> bool
pub fn contains(&self, key: i64) -> bool
Reports whether an unclaimed value is stored under the key.
Sourcepub fn remaining_keys(&self) -> Vec<i64>
pub fn remaining_keys(&self) -> Vec<i64>
Lists the keys whose values have not been claimed yet.
Trait Implementations§
Source§impl<'a> Clone for MapEntries<'a>
impl<'a> Clone for MapEntries<'a>
Source§impl<'a> Debug for MapEntries<'a>
impl<'a> Debug for MapEntries<'a>
impl<'a> Eq for MapEntries<'a>
Source§impl<'a> MapEntryAccess<'a> for MapEntries<'a>
impl<'a> MapEntryAccess<'a> for MapEntries<'a>
Source§fn take(&mut self, key: i64) -> Option<&'a [u8]>
fn take(&mut self, key: i64) -> Option<&'a [u8]>
Removes and returns the raw value stored under the key, if still present.
Source§fn contains(&self, key: i64) -> bool
fn contains(&self, key: i64) -> bool
Reports whether an unclaimed value is stored under the key.
Source§fn remaining_keys(&self) -> Vec<i64>
fn remaining_keys(&self) -> Vec<i64>
Lists the keys whose values have not been claimed yet.
Source§impl<'a> PartialEq for MapEntries<'a>
impl<'a> PartialEq for MapEntries<'a>
impl<'a> StructuralPartialEq for MapEntries<'a>
Auto Trait Implementations§
impl<'a> Freeze for MapEntries<'a>
impl<'a> RefUnwindSafe for MapEntries<'a>
impl<'a> Send for MapEntries<'a>
impl<'a> Sync for MapEntries<'a>
impl<'a> Unpin for MapEntries<'a>
impl<'a> UnsafeUnpin for MapEntries<'a>
impl<'a> UnwindSafe for MapEntries<'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