pub struct MappedLexicon { /* private fields */ }Expand description
Memory-mapped lexicon view with owning storage.
Binary search over on-disk sorted trigram table.
Implementations§
Source§impl MappedLexicon
impl MappedLexicon
Sourcepub fn from_entries(entries: &[LexiconEntry]) -> Self
pub fn from_entries(entries: &[LexiconEntry]) -> Self
Construct from a list of lexicon entries (used by the builder for in-memory index).
§Panics
Panics if entries.len() exceeds u32::MAX.
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
Sourcepub fn get(&self, tri: [u8; 3]) -> Option<LexiconEntry>
pub fn get(&self, tri: [u8; 3]) -> Option<LexiconEntry>
Binary search for tri in the mapped lexicon. Returns the entry if found.
§Panics
Panics if the internal data layout is corrupted (out of bounds read).
pub const fn iter(&self) -> MappedLexiconIter<'_> ⓘ
pub fn backing_slice(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl Debug for MappedLexicon
impl Debug for MappedLexicon
Source§impl<'a> IntoIterator for &'a MappedLexicon
impl<'a> IntoIterator for &'a MappedLexicon
Auto Trait Implementations§
impl Freeze for MappedLexicon
impl RefUnwindSafe for MappedLexicon
impl Send for MappedLexicon
impl Sync for MappedLexicon
impl Unpin for MappedLexicon
impl UnsafeUnpin for MappedLexicon
impl UnwindSafe for MappedLexicon
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more