pub struct StateTable {
pub data: DashMap<Value, Value>,
pub lookup_indexes: HashMap<String, LookupIndex>,
pub temporal_indexes: HashMap<String, TemporalIndex>,
pub pda_reverse_lookups: HashMap<String, PdaReverseLookup>,
pub pending_updates: DashMap<String, Vec<PendingAccountUpdate>>,
/* private fields */
}Fields§
§data: DashMap<Value, Value>§lookup_indexes: HashMap<String, LookupIndex>§temporal_indexes: HashMap<String, TemporalIndex>§pda_reverse_lookups: HashMap<String, PdaReverseLookup>§pending_updates: DashMap<String, Vec<PendingAccountUpdate>>Implementations§
Source§impl StateTable
impl StateTable
pub fn is_at_capacity(&self) -> bool
pub fn entries_over_limit(&self) -> usize
pub fn max_array_length(&self) -> usize
pub fn insert_with_eviction(&self, key: Value, value: Value)
pub fn get_and_touch(&self, key: &Value) -> Option<Value>
Sourcepub fn is_fresh_update(
&self,
primary_key: &Value,
event_type: &str,
slot: u64,
ordering_value: u64,
) -> bool
pub fn is_fresh_update( &self, primary_key: &Value, event_type: &str, slot: u64, ordering_value: u64, ) -> bool
Check if an update is fresh and update the version tracker. Returns true if the update should be processed (is fresh). Returns false if the update is stale and should be skipped.
Comparison is lexicographic on (slot, ordering_value): (100, 5) > (100, 3) > (99, 999)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StateTable
impl !RefUnwindSafe for StateTable
impl Send for StateTable
impl Sync for StateTable
impl Unpin for StateTable
impl UnwindSafe for StateTable
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