Struct solana_runtime::rolling_bit_field::RollingBitField
source · pub struct RollingBitField {
max_width: u64,
min: u64,
max_exclusive: u64,
bits: BitVec,
count: usize,
excess: HashSet<u64>,
}
Fields§
§max_width: u64
§min: u64
§max_exclusive: u64
§bits: BitVec
§count: usize
§excess: HashSet<u64>
Implementations§
source§impl RollingBitField
impl RollingBitField
functionally similar to a hashset Relies on there being a sliding window of key values. The key values continue to increase. Old key values are removed from the lesser values and do not accumulate.
pub fn new(max_width: u64) -> Self
fn get_address(&self, key: &u64) -> u64
pub fn range_width(&self) -> u64
pub fn min(&self) -> Option<u64>
pub fn insert(&mut self, key: u64)
fn all_items_in_excess(&self) -> bool
fn purge(&mut self, key: &u64)
fn contains_assume_in_range(&self, key: &u64) -> bool
pub fn contains(&self, key: &u64) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn max_exclusive(&self) -> u64
pub fn max_inclusive(&self) -> u64
sourcepub fn get_all_less_than(&self, max_slot_exclusive: Slot) -> Vec<u64>
pub fn get_all_less_than(&self, max_slot_exclusive: Slot) -> Vec<u64>
return all items < ‘max_slot_exclusive’
sourcepub fn get_prior(&self, max_slot_exclusive: Slot) -> Option<Slot>
pub fn get_prior(&self, max_slot_exclusive: Slot) -> Option<Slot>
return highest item < ‘max_slot_exclusive’
pub fn get_all(&self) -> Vec<u64>
Trait Implementations§
source§impl AbiExample for RollingBitField
impl AbiExample for RollingBitField
source§impl Clone for RollingBitField
impl Clone for RollingBitField
source§fn clone(&self) -> RollingBitField
fn clone(&self) -> RollingBitField
Returns a copy 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 Debug for RollingBitField
impl Debug for RollingBitField
source§impl Default for RollingBitField
impl Default for RollingBitField
source§fn default() -> RollingBitField
fn default() -> RollingBitField
Returns the “default value” for a type. Read more
source§impl PartialEq<RollingBitField> for RollingBitField
impl PartialEq<RollingBitField> for RollingBitField
Auto Trait Implementations§
impl RefUnwindSafe for RollingBitField
impl Send for RollingBitField
impl Sync for RollingBitField
impl Unpin for RollingBitField
impl UnwindSafe for RollingBitField
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