pub struct StandardHashTable { /* private fields */ }Expand description
Hash table for block deduplication with identity hashing.
Uses an identity hasher since keys are BLAKE3 hashes (already uniformly distributed), giving ~3-6x speedup over the default SipHash.
Implementations§
Source§impl StandardHashTable
impl StandardHashTable
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn insert(&mut self, hash: [u8; 32], offset: u64) -> Option<u64>
pub fn get(&self, hash: &[u8; 32]) -> Option<u64>
pub fn load_factor(&self) -> f64
pub fn memory_bytes(&self) -> usize
pub fn stats(&self) -> TableStats
Trait Implementations§
Source§impl Default for StandardHashTable
impl Default for StandardHashTable
impl Sync for StandardHashTable
Auto Trait Implementations§
impl !Freeze for StandardHashTable
impl !RefUnwindSafe for StandardHashTable
impl Send for StandardHashTable
impl Unpin for StandardHashTable
impl UnsafeUnpin for StandardHashTable
impl UnwindSafe for StandardHashTable
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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