pub struct ProgramCacheForTxBatch {
pub hit_max_limit: bool,
pub loaded_missing: bool,
pub merged_modified: bool,
/* private fields */
}agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Expand description
Local view into ProgramCache which was extracted for a specific TX batch.
This isolation enables the global ProgramCache to continue to evolve (e.g. evictions), while the TX batch is guaranteed it will continue to find all the programs it requires. For program management instructions this also buffers them before they are merged back into the global ProgramCache.
Fieldsยง
ยงhit_max_limit: boolagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.loaded_missing: boolagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.merged_modified: boolagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Implementationsยง
Sourceยงimpl ProgramCacheForTxBatch
impl ProgramCacheForTxBatch
pub fn new(slot: Slot) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn replenish(
&mut self,
key: Pubkey,
entry: Arc<ProgramCacheEntry>,
) -> (bool, Arc<ProgramCacheEntry>)
๐Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn replenish( &mut self, key: Pubkey, entry: Arc<ProgramCacheEntry>, ) -> (bool, Arc<ProgramCacheEntry>)
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Refill the cache with a single entry. Itโs typically called during transaction loading, and
transaction processing (for program management instructions).
It replaces the existing entry (if any) with the provided entry. The return value contains
true if an entry existed.
The function also returns the newly inserted value.
Sourcepub fn store_modified_entry(
&mut self,
key: Pubkey,
entry: Arc<ProgramCacheEntry>,
)
๐Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn store_modified_entry( &mut self, key: Pubkey, entry: Arc<ProgramCacheEntry>, )
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Store an entry in modified_entries for a program modified during the
transaction batch.
Sourcepub fn drain_modified_entries(
&mut self,
) -> HashMap<Pubkey, Arc<ProgramCacheEntry>>
๐Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn drain_modified_entries( &mut self, ) -> HashMap<Pubkey, Arc<ProgramCacheEntry>>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Drain the program cacheโs modified entries, returning the owned collection.
pub fn find(&self, key: &Pubkey) -> Option<Arc<ProgramCacheEntry>>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn slot(&self) -> Slot
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn set_slot_for_tests(&mut self, slot: Slot)
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn merge( &mut self, modified_entries: &HashMap<Pubkey, Arc<ProgramCacheEntry>>, )
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn is_empty(&self) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Trait Implementationsยง
Sourceยงimpl Clone for ProgramCacheForTxBatch
impl Clone for ProgramCacheForTxBatch
Sourceยงfn clone(&self) -> ProgramCacheForTxBatch
fn clone(&self) -> ProgramCacheForTxBatch
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl Debug for ProgramCacheForTxBatch
impl Debug for ProgramCacheForTxBatch
Sourceยงimpl Default for ProgramCacheForTxBatch
impl Default for ProgramCacheForTxBatch
Sourceยงfn default() -> ProgramCacheForTxBatch
fn default() -> ProgramCacheForTxBatch
Auto Trait Implementationsยง
impl Freeze for ProgramCacheForTxBatch
impl RefUnwindSafe for ProgramCacheForTxBatch
impl Send for ProgramCacheForTxBatch
impl Sync for ProgramCacheForTxBatch
impl Unpin for ProgramCacheForTxBatch
impl UnwindSafe for ProgramCacheForTxBatch
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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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