pub struct MapView<'a> { /* private fields */ }Expand description
A zero-copy view over an encoded ProtoCache map and its perfect-hash index.
Implementations§
Source§impl<'a> MapView<'a>
impl<'a> MapView<'a>
Sourcepub fn new(words: &'a [u32]) -> Option<Self>
pub fn new(words: &'a [u32]) -> Option<Self>
Parses an encoded map and validates its structural header.
Sourcepub fn detect_len(words: &'a [u32]) -> Option<usize>
pub fn detect_len(words: &'a [u32]) -> Option<usize>
Detects the complete encoded map length, including keys and values.
Sourcepub fn detect(words: &'a [u32]) -> Option<&'a [u32]>
pub fn detect(words: &'a [u32]) -> Option<&'a [u32]>
Returns the exact encoded slice occupied by a valid map.
pub fn is_empty(self) -> bool
Sourcepub fn pair(self, index: usize) -> Option<PairView<'a>>
pub fn pair(self, index: usize) -> Option<PairView<'a>>
Returns the raw pair stored at perfect-hash position index.
pub fn expect_pair(self, index: usize) -> PairView<'a>
pub fn iter(self) -> MapIter<'a> ⓘ
Sourcepub fn find_bytes(self, key: &[u8]) -> Option<PairView<'a>>
pub fn find_bytes(self, key: &[u8]) -> Option<PairView<'a>>
Looks up an arbitrary byte-string key.
Trait Implementations§
impl<'a> Copy for MapView<'a>
Auto Trait Implementations§
impl<'a> Freeze for MapView<'a>
impl<'a> RefUnwindSafe for MapView<'a>
impl<'a> Send for MapView<'a>
impl<'a> Sync for MapView<'a>
impl<'a> Unpin for MapView<'a>
impl<'a> UnsafeUnpin for MapView<'a>
impl<'a> UnwindSafe for MapView<'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