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<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>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn root_slot_deltas(&self) -> Vec<SlotDelta<T>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn root_slot_deltas(&self) -> Vec<SlotDelta<T>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
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 more
sourceimpl<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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more