pub struct EntropyMapBitpackedLookup { /* private fields */ }Expand description
Wrapper around entropy-map’s MapWithDictBitpacked for u32 -> u8 lookups This version uses bitpacking for even more compact storage Note: For now, we’ll use a simpler approach and just use MapWithDict with a different name TODO: Implement proper MapWithDictBitpacked support when API is clearer
Implementations§
Source§impl EntropyMapBitpackedLookup
impl EntropyMapBitpackedLookup
Sourcepub fn new(entries: &[(u32, u8)]) -> (Self, u64)
pub fn new(entries: &[(u32, u8)]) -> (Self, u64)
Create a new bitpacked entropy map from key-value pairs Returns the map and construction time in nanoseconds
Sourcepub fn lookup_batch(&self, keys: &[u32], results: &mut [u8])
pub fn lookup_batch(&self, keys: &[u32], results: &mut [u8])
Lookup multiple values at once
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get memory usage information
Auto Trait Implementations§
impl Freeze for EntropyMapBitpackedLookup
impl RefUnwindSafe for EntropyMapBitpackedLookup
impl Send for EntropyMapBitpackedLookup
impl Sync for EntropyMapBitpackedLookup
impl Unpin for EntropyMapBitpackedLookup
impl UnsafeUnpin for EntropyMapBitpackedLookup
impl UnwindSafe for EntropyMapBitpackedLookup
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