Struct solana_runtime::status_cache::StatusCache
source · [−]Implementations
sourceimpl<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<u64>
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>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
pub fn append(&mut self, slot_deltas: &[SlotDelta<T>])
pub fn from_slot_deltas(slot_deltas: &[SlotDelta<T>]) -> Self
Trait Implementations
sourceimpl<T: Serialize + Clone> AbiExample for StatusCache<T>
impl<T: Serialize + Clone> AbiExample for StatusCache<T>
sourceimpl<T: Clone + Serialize + Clone> Clone for StatusCache<T>
impl<T: Clone + Serialize + Clone> Clone for StatusCache<T>
sourcefn clone(&self) -> StatusCache<T>
fn clone(&self) -> StatusCache<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: Serialize + Clone> Default for StatusCache<T>
impl<T: Serialize + Clone> Default for StatusCache<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for StatusCache<T>where
T: RefUnwindSafe,
impl<T> Send for StatusCache<T>where
T: Send,
impl<T> Sync for StatusCache<T>where
T: Send + Sync,
impl<T> Unpin for StatusCache<T>where
T: Unpin,
impl<T> UnwindSafe for StatusCache<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more