Struct solana_runtime::status_cache::StatusCache
source · pub struct StatusCache<T: Serialize + Clone> { /* private fields */ }
Implementations§
source§impl<T: Serialize + Clone> StatusCache<T>
impl<T: Serialize + Clone> StatusCache<T>
pub fn clear_slot_entries(&mut self, slot: Slot)
sourcepub fn get_status<K: AsRef<[u8]>>(
&self,
key: K,
transaction_blockhash: &Hash,
ancestors: &Ancestors
) -> Option<(Slot, T)>
pub fn get_status<K: AsRef<[u8]>>( &self, key: K, transaction_blockhash: &Hash, ancestors: &Ancestors ) -> Option<(Slot, T)>
Check if the key is in any of the forks in the ancestors set and with a certain blockhash.
sourcepub fn get_status_any_blockhash<K: AsRef<[u8]>>(
&self,
key: K,
ancestors: &Ancestors
) -> Option<(Slot, T)>
pub fn get_status_any_blockhash<K: AsRef<[u8]>>( &self, key: K, ancestors: &Ancestors ) -> Option<(Slot, T)>
Search for a key with any blockhash Prefer get_status for performance reasons, it doesn’t need to search all blockhashes.
sourcepub fn add_root(&mut self, fork: Slot)
pub fn add_root(&mut self, fork: Slot)
Add a known root fork. Roots are always valid ancestors. After MAX_CACHE_ENTRIES, roots are removed, and any old keys are cleared.
pub fn roots(&self) -> &HashSet<Slot>
sourcepub fn insert<K: AsRef<[u8]>>(
&mut self,
transaction_blockhash: &Hash,
key: K,
slot: Slot,
res: T
)
pub fn insert<K: AsRef<[u8]>>( &mut self, transaction_blockhash: &Hash, key: K, slot: Slot, res: T )
Insert a new key for a specific slot.
pub fn purge_roots(&mut self)
pub fn slot_deltas(&self, slots: &[Slot]) -> Vec<SlotDelta<T>> ⓘ
sourcepub fn root_slot_deltas(&self) -> Vec<SlotDelta<T>> ⓘ
pub fn root_slot_deltas(&self) -> Vec<SlotDelta<T>> ⓘ
Get the statuses for all the root slots
pub fn append(&mut self, slot_deltas: &[SlotDelta<T>])
pub fn from_slot_deltas(slot_deltas: &[SlotDelta<T>]) -> Self
Trait Implementations§
source§impl<T: Serialize + Clone> AbiExample for StatusCache<T>
impl<T: Serialize + Clone> AbiExample for StatusCache<T>
source§impl<T: Clone + Serialize + Clone> Clone for StatusCache<T>
impl<T: Clone + Serialize + Clone> Clone for StatusCache<T>
source§fn clone(&self) -> StatusCache<T>
fn clone(&self) -> StatusCache<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more