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: 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 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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