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)
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: 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 moreAuto Trait Implementations§
impl<T> Freeze for StatusCache<T>
impl<T> RefUnwindSafe for StatusCache<T>where
T: RefUnwindSafe,
impl<T> Send for StatusCache<T>where
T: Send,
impl<T> Sync for StatusCache<T>
impl<T> Unpin for StatusCache<T>where
T: Unpin,
impl<T> UnwindSafe for StatusCache<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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