pub struct LoadedProgramsForTxBatch {
pub environments: ProgramRuntimeEnvironments,
pub upcoming_environments: Option<ProgramRuntimeEnvironments>,
pub latest_root_epoch: Epoch,
pub hit_max_limit: bool,
/* private fields */
}
Fields§
§environments: ProgramRuntimeEnvironments
§upcoming_environments: Option<ProgramRuntimeEnvironments>
Anticipated replacement for environments
at the next epoch.
This is None
during most of an epoch, and only Some
around the boundaries (at the end and beginning of an epoch).
More precisely, it starts with the recompilation phase a few hundred slots before the epoch boundary,
and it ends with the first rerooting after the epoch boundary.
Needed when a program is deployed at the last slot of an epoch, becomes effective in the next epoch.
So needs to be compiled with the environment for the next epoch.
latest_root_epoch: Epoch
The epoch of the last rerooting
hit_max_limit: bool
Implementations§
source§impl LoadedProgramsForTxBatch
impl LoadedProgramsForTxBatch
pub fn new( slot: Slot, environments: ProgramRuntimeEnvironments, upcoming_environments: Option<ProgramRuntimeEnvironments>, latest_root_epoch: Epoch, ) -> Self
pub fn new_from_cache<FG: ForkGraph>( slot: Slot, epoch: Epoch, cache: &LoadedPrograms<FG>, ) -> Self
sourcepub fn get_environments_for_epoch(
&self,
epoch: Epoch,
) -> &ProgramRuntimeEnvironments
pub fn get_environments_for_epoch( &self, epoch: Epoch, ) -> &ProgramRuntimeEnvironments
Returns the current environments depending on the given epoch
sourcepub fn replenish(
&mut self,
key: Pubkey,
entry: Arc<LoadedProgram>,
) -> (bool, Arc<LoadedProgram>)
pub fn replenish( &mut self, key: Pubkey, entry: Arc<LoadedProgram>, ) -> (bool, Arc<LoadedProgram>)
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.
pub fn find(&self, key: &Pubkey) -> Option<Arc<LoadedProgram>>
pub fn slot(&self) -> Slot
pub fn set_slot_for_tests(&mut self, slot: Slot)
pub fn merge(&mut self, other: &Self)
Trait Implementations§
source§impl Clone for LoadedProgramsForTxBatch
impl Clone for LoadedProgramsForTxBatch
source§fn clone(&self) -> LoadedProgramsForTxBatch
fn clone(&self) -> LoadedProgramsForTxBatch
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LoadedProgramsForTxBatch
impl Debug for LoadedProgramsForTxBatch
source§impl Default for LoadedProgramsForTxBatch
impl Default for LoadedProgramsForTxBatch
source§fn default() -> LoadedProgramsForTxBatch
fn default() -> LoadedProgramsForTxBatch
Auto Trait Implementations§
impl Freeze for LoadedProgramsForTxBatch
impl RefUnwindSafe for LoadedProgramsForTxBatch
impl Send for LoadedProgramsForTxBatch
impl Sync for LoadedProgramsForTxBatch
impl Unpin for LoadedProgramsForTxBatch
impl UnwindSafe for LoadedProgramsForTxBatch
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
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