pub struct SecondaryIndex<SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send> {
pub index: DashMap<Pubkey, SecondaryIndexEntryType>,
pub reverse_index: DashMap<Pubkey, SecondaryReverseIndexEntry>,
/* private fields */
}
Fields§
§index: DashMap<Pubkey, SecondaryIndexEntryType>
§reverse_index: DashMap<Pubkey, SecondaryReverseIndexEntry>
Implementations§
Source§impl<SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send> SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send> SecondaryIndex<SecondaryIndexEntryType>
pub fn new(metrics_name: &'static str) -> Self
pub fn insert(&self, key: &Pubkey, inner_key: &Pubkey)
pub fn remove_by_inner_key(&self, inner_key: &Pubkey)
pub fn get(&self, key: &Pubkey) -> Vec<Pubkey>
Sourcepub fn log_contents(&self)
pub fn log_contents(&self)
log top 20 (owner, # accounts) in descending order of # accounts
Trait Implementations§
Source§impl<SecondaryIndexEntryType: Debug + SecondaryIndexEntry + Default + Sync + Send> Debug for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType: Debug + SecondaryIndexEntry + Default + Sync + Send> Debug for SecondaryIndex<SecondaryIndexEntryType>
Source§impl<SecondaryIndexEntryType: Default + SecondaryIndexEntry + Default + Sync + Send> Default for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType: Default + SecondaryIndexEntry + Default + Sync + Send> Default for SecondaryIndex<SecondaryIndexEntryType>
Source§fn default() -> SecondaryIndex<SecondaryIndexEntryType>
fn default() -> SecondaryIndex<SecondaryIndexEntryType>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<SecondaryIndexEntryType> !Freeze for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType> !RefUnwindSafe for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType> Send for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType> Sync for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType> Unpin for SecondaryIndex<SecondaryIndexEntryType>
impl<SecondaryIndexEntryType> UnwindSafe for SecondaryIndex<SecondaryIndexEntryType>where
SecondaryIndexEntryType: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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