pub struct ActiveFeatures { /* private fields */ }Expand description
Immutable per-block snapshot of active features.
Built once per bank inside execute_blob, immediately after
update_clock, and held under Arc so every consumer in the block sees
the same view. There is no mid-block mutation, no lazy refresh, and no
cross-block caching.
Implementations§
Source§impl ActiveFeatures
impl ActiveFeatures
Sourcepub fn from_features_state(
state: &FeaturesState,
current_time_ms: u64,
snapshot_slot: Slot,
) -> Self
pub fn from_features_state( state: &FeaturesState, current_time_ms: u64, snapshot_slot: Slot, ) -> Self
Build the snapshot for a bank by evaluating FeaturesState against
the current clock. Every entry whose window currently includes
current_time_ms is added to the snapshot, keyed by snapshot_slot
(the current bank slot — informational, not the historical activation
slot, which would require on-chain state the design intentionally
avoids).
This is the canonical producer the bank calls inside
recompute_active_features. Construction lives here (not in the
caller) so the producer surface stays in this crate; from_map can
remain pub(crate).
Sourcepub fn is_active(&self, feature: &str) -> bool
pub fn is_active(&self, feature: &str) -> bool
Returns true if feature is active in this snapshot.
Sourcepub fn snapshot_slot(&self, feature: &str) -> Option<Slot>
pub fn snapshot_slot(&self, feature: &str) -> Option<Slot>
Returns the recorded snapshot slot for feature, if active.
This is the bank slot at the moment the snapshot was computed, not the historical activation slot.
Trait Implementations§
Source§impl Clone for ActiveFeatures
impl Clone for ActiveFeatures
Source§fn clone(&self) -> ActiveFeatures
fn clone(&self) -> ActiveFeatures
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActiveFeatures
impl Debug for ActiveFeatures
Source§impl Default for ActiveFeatures
impl Default for ActiveFeatures
Source§fn default() -> ActiveFeatures
fn default() -> ActiveFeatures
Source§impl PartialEq for ActiveFeatures
impl PartialEq for ActiveFeatures
Source§fn eq(&self, other: &ActiveFeatures) -> bool
fn eq(&self, other: &ActiveFeatures) -> bool
self and other values to be equal, and is used by ==.impl Eq for ActiveFeatures
impl StructuralPartialEq for ActiveFeatures
Auto Trait Implementations§
impl Freeze for ActiveFeatures
impl RefUnwindSafe for ActiveFeatures
impl Send for ActiveFeatures
impl Sync for ActiveFeatures
impl Unpin for ActiveFeatures
impl UnsafeUnpin for ActiveFeatures
impl UnwindSafe for ActiveFeatures
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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