Struct solana_bucket_map::bucket_map::BucketMap
source · pub struct BucketMap<T: Clone + Copy + Debug> {
pub stats: Arc<BucketMapStats>,
pub temp_dir: Option<TempDir>,
/* private fields */
}
Fields§
§stats: Arc<BucketMapStats>
§temp_dir: Option<TempDir>
Implementations§
source§impl<T: Clone + Copy + Debug> BucketMap<T>
impl<T: Clone + Copy + Debug> 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)where
F: FnMut(Option<(&[T], RefCount)>) -> Option<(Vec<T>, RefCount)>,
pub fn update<F>(&self, key: &Pubkey, updatefn: F)where F: FnMut(Option<(&[T], RefCount)>) -> Option<(Vec<T>, RefCount)>,
Update Pubkey key
’s value with function updatefn