pub struct TwoToPowerBits { /* private fields */ }Expand description
Size being the power of two.
Implementations§
Source§impl TwoToPowerBits
impl TwoToPowerBits
Sourcepub fn new(log2size: u8) -> Self
pub fn new(log2size: u8) -> Self
Returns TwoToPowerBits that represent two to power of log2size.
Trait Implementations§
Source§impl Clone for TwoToPowerBits
impl Clone for TwoToPowerBits
Source§fn clone(&self) -> TwoToPowerBits
fn clone(&self) -> TwoToPowerBits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl GroupSize for TwoToPowerBits
impl GroupSize for TwoToPowerBits
Source§fn hash_to_group(&self, hash: u32) -> u8
fn hash_to_group(&self, hash: u32) -> u8
Returns
hash modulo self.Source§fn level_size_groups_segments(
&self,
desired_total_size: usize,
) -> (usize, usize)
fn level_size_groups_segments( &self, desired_total_size: usize, ) -> (usize, usize)
Returns number of groups and 64-bit segments for given
desired_total_size.fn validate(&self) -> Result<Self, &'static str>
Source§fn in_group_index(&self, hash: u64, group_seed: u16) -> u8
fn in_group_index(&self, hash: u64, group_seed: u16) -> u8
Returns index in the group with given seed
group_seed using hasher
which must be modified earlier by group_nr function.Source§fn bit_index_for_seed(&self, hash: u64, group_seed: u16, group: usize) -> usize
fn bit_index_for_seed(&self, hash: u64, group_seed: u16, group: usize) -> usize
Returns bit index inside the group with number
group and seed group_seed,
assigned to the key hashed by the hasher.Source§fn copy_group_if_better<CB>(
&self,
dst: &mut [u64],
src: &[u64],
group_index: usize,
callback: CB,
)where
CB: FnOnce(),
fn copy_group_if_better<CB>(
&self,
dst: &mut [u64],
src: &[u64],
group_index: usize,
callback: CB,
)where
CB: FnOnce(),
Returns number of ones in the group.
If group with given index has more ones in
dst than in src, then copy it from src to dst and call callback.Source§fn write_size_bytes(&self) -> usize
fn write_size_bytes(&self) -> usize
Returns number of bytes that
self.write writes to the output.Source§impl Into<u8> for TwoToPowerBits
impl Into<u8> for TwoToPowerBits
Source§impl Mul<usize> for TwoToPowerBits
impl Mul<usize> for TwoToPowerBits
Source§impl TryFrom<u8> for TwoToPowerBits
impl TryFrom<u8> for TwoToPowerBits
impl Copy for TwoToPowerBits
Auto Trait Implementations§
impl Freeze for TwoToPowerBits
impl RefUnwindSafe for TwoToPowerBits
impl Send for TwoToPowerBits
impl Sync for TwoToPowerBits
impl Unpin for TwoToPowerBits
impl UnsafeUnpin for TwoToPowerBits
impl UnwindSafe for TwoToPowerBits
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, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.