pub type BankStatusCache = StatusCache<Result<()>>;

Aliased Type§

struct BankStatusCache { /* private fields */ }

Implementations§

source§

impl<T: Serialize + Clone> StatusCache<T>

source

pub fn clear_slot_entries(&mut self, slot: Slot)

source

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.

source

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.

source

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.

source

pub fn roots(&self) -> &HashSet<Slot>

source

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.

source

pub fn purge_roots(&mut self)

source

pub fn clear(&mut self)

Clear for testing

source

pub fn root_slot_deltas(&self) -> Vec<SlotDelta<T>>

Get the statuses for all the root slots

source

pub fn append(&mut self, slot_deltas: &[SlotDelta<T>])

source

pub fn from_slot_deltas(slot_deltas: &[SlotDelta<T>]) -> Self

Trait Implementations§

source§

impl<T: Serialize + Clone> AbiExample for StatusCache<T>

source§

fn example() -> Self

source§

impl<T: Clone + Serialize + Clone> Clone for StatusCache<T>

source§

fn clone(&self) -> StatusCache<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + Serialize + Clone> Debug for StatusCache<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Serialize + Clone> Default for StatusCache<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: Serialize + Clone + PartialEq> PartialEq<StatusCache<T>> for StatusCache<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.