pub struct SlotContext {
pub slot: u64,
pub slot_index: u64,
pub slot_index_domain: SlotIndexDomain,
}Expand description
Slot context for ordering mutations by blockchain position.
Used to derive _seq field for default recency sorting.
Fields§
§slot: u64Solana slot number
slot_index: u64Index within the slot (write_version for accounts, txn_index for instructions)
slot_index_domain: SlotIndexDomainThe producer-local domain in which slot_index is ordered.
Implementations§
Source§impl SlotContext
impl SlotContext
pub fn with_domain( slot: u64, slot_index: u64, slot_index_domain: SlotIndexDomain, ) -> Self
Sourcepub fn new(slot: u64, slot_index: u64) -> Self
pub fn new(slot: u64, slot_index: u64) -> Self
Construct a context in the legacy generic domain.
Generated ingestion uses the explicit constructors below so account, instruction and resolver offsets are never compared accidentally.
pub fn account(slot: u64, write_version: u64) -> Self
pub fn instruction(slot: u64, txn_index: u64) -> Self
pub fn resolver(slot: u64, resolver_index: u64) -> Self
Sourcepub fn to_seq_string(&self) -> String
pub fn to_seq_string(&self) -> String
Compute a monotonic sequence number for sorting. Encodes as string to preserve precision in JSON: “{slot}:{slot_index:012}” This gives lexicographic ordering that matches (slot, slot_index) tuple ordering.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlotContext
impl RefUnwindSafe for SlotContext
impl Send for SlotContext
impl Sync for SlotContext
impl Unpin for SlotContext
impl UnsafeUnpin for SlotContext
impl UnwindSafe for SlotContext
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