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
sourceimpl<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
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> RefUnwindSafe for BucketMap<T>
impl<T> Send for BucketMap<T> where
T: Send + Sync,
impl<T> Sync for BucketMap<T> where
T: Send + Sync,
impl<T> Unpin for BucketMap<T>
impl<T> UnwindSafe for BucketMap<T>
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more