pub struct BucketMap<T: Clone + Copy + Debug + PartialEq + 'static> {
pub stats: Arc<BucketMapStats>,
pub temp_dir: Option<TempDir>,
pub erase_drives_on_drop: bool,
/* private fields */
}
Fields§
§stats: Arc<BucketMapStats>
§temp_dir: Option<TempDir>
§erase_drives_on_drop: bool
true if dropping self removes all folders. This is primarily for test environments.
Implementations§
source§impl<T: Clone + Copy + Debug + PartialEq> BucketMap<T>
impl<T: Clone + Copy + Debug + PartialEq> BucketMap<T>
pub fn new(config: BucketMapConfig) -> Self
pub fn num_buckets(&self) -> usize
sourcepub fn read_value(&self, key: &Pubkey) -> Option<(Vec<T>, RefCount)>
pub fn read_value(&self, key: &Pubkey) -> Option<(Vec<T>, RefCount)>
Get the values for Pubkey key
sourcepub fn delete_key(&self, key: &Pubkey)
pub fn delete_key(&self, key: &Pubkey)
Delete the Pubkey key
sourcepub fn insert(&self, key: &Pubkey, value: (&[T], RefCount))
pub fn insert(&self, key: &Pubkey, value: (&[T], RefCount))
Update Pubkey key
’s value with ‘value’
sourcepub fn try_insert(
&self,
key: &Pubkey,
value: (&[T], RefCount),
) -> Result<(), BucketMapError>
pub fn try_insert( &self, key: &Pubkey, value: (&[T], RefCount), ) -> Result<(), BucketMapError>
Update Pubkey key
’s value with ‘value’
sourcepub fn update<F>(&self, key: &Pubkey, updatefn: F)
pub fn update<F>(&self, key: &Pubkey, updatefn: F)
Update Pubkey key
’s value with function updatefn
pub fn get_bucket(&self, key: &Pubkey) -> &Arc<BucketApi<T>>
pub fn get_bucket_from_index(&self, ix: usize) -> &Arc<BucketApi<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for BucketMap<T>
impl<T> RefUnwindSafe for BucketMap<T>
impl<T> Send for BucketMap<T>where
T: Sync,
impl<T> Sync for BucketMap<T>where
T: Sync,
impl<T> Unpin for BucketMap<T>
impl<T> UnwindSafe for BucketMap<T>
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