pub struct BucketApi<T: Clone + Copy + PartialEq + 'static> {
pub stats: Arc<BucketMapStats>,
/* private fields */
}
Fields§
§stats: Arc<BucketMapStats>
Implementations§
source§impl<T: Clone + Copy + PartialEq + Debug> BucketApi<T>
impl<T: Clone + Copy + PartialEq + Debug> BucketApi<T>
sourcepub fn items_in_range<R>(&self, range: &Option<&R>) -> Vec<BucketItem<T>>where
R: RangeBounds<Pubkey>,
pub fn items_in_range<R>(&self, range: &Option<&R>) -> Vec<BucketItem<T>>where
R: RangeBounds<Pubkey>,
Get the items for bucket
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
pub fn bucket_len(&self) -> u64
pub fn delete_key(&self, key: &Pubkey)
pub fn insert(&self, pubkey: &Pubkey, value: (&[T], RefCount))
pub fn grow(&self, err: BucketMapError)
sourcepub fn set_anticipated_count(&self, count: u64)
pub fn set_anticipated_count(&self, count: u64)
caller can specify that the index needs to hold approximately count
entries soon.
This gives a hint to the resizing algorithm and prevents repeated incremental resizes.
sourcepub fn batch_insert_non_duplicates(
&self,
items: &[(Pubkey, T)],
) -> Vec<(usize, T)>
pub fn batch_insert_non_duplicates( &self, items: &[(Pubkey, T)], ) -> Vec<(usize, T)>
batch insert of items
. Assumption is a single slot list element and ref_count == 1.
For any pubkeys that already exist, the index in items
of the failed insertion and the existing data (previously put in the index) are returned.
pub fn update<F>(&self, key: &Pubkey, updatefn: F)
pub fn try_write( &self, pubkey: &Pubkey, value: (&[T], RefCount), ) -> Result<(), BucketMapError>
Auto Trait Implementations§
impl<T> !Freeze for BucketApi<T>
impl<T> RefUnwindSafe for BucketApi<T>
impl<T> Send for BucketApi<T>where
T: Sync,
impl<T> Sync for BucketApi<T>where
T: Sync,
impl<T> Unpin for BucketApi<T>
impl<T> UnwindSafe for BucketApi<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