pub struct CachedExecutors {
pub executors: HashMap<Pubkey, CachedExecutorsEntry>,
pub stats: Stats,
/* private fields */
}Expand description
LFU Cache of executors with single-epoch memory of usage counts
Fields§
§executors: HashMap<Pubkey, CachedExecutorsEntry>§stats: StatsImplementations§
Source§impl CachedExecutors
impl CachedExecutors
pub fn new(max_capacity: usize, current_epoch: Epoch) -> Self
pub fn new_from_parent_bank_executors( parent_bank_executors: &CachedExecutors, current_epoch: Epoch, ) -> Self
pub fn get(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>
pub fn put(&mut self, executors: &[(&Pubkey, Arc<dyn Executor>)])
pub fn remove(&mut self, pubkey: &Pubkey) -> Option<CachedExecutorsEntry>
pub fn clear(&mut self)
pub fn get_primer_count_upper_bound_inclusive(counts: &[(&Pubkey, u64)]) -> u64
pub fn get_primer_counts( counts: &[(&Pubkey, u64)], num_counts: usize, ) -> Vec<u64>
Trait Implementations§
Source§impl AbiExample for CachedExecutors
Available on RUSTC_WITH_SPECIALIZATION only.
impl AbiExample for CachedExecutors
Available on
RUSTC_WITH_SPECIALIZATION only.Source§impl Debug for CachedExecutors
impl Debug for CachedExecutors
Auto Trait Implementations§
impl !Freeze for CachedExecutors
impl !RefUnwindSafe for CachedExecutors
impl Send for CachedExecutors
impl Sync for CachedExecutors
impl Unpin for CachedExecutors
impl !UnwindSafe for CachedExecutors
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