pub struct SlotContext {
pub slot: u64,
pub slot_index: u64,
}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)
Implementations§
Source§impl SlotContext
impl SlotContext
pub fn new(slot: u64, slot_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§
Source§impl Clone for SlotContext
impl Clone for SlotContext
Source§fn clone(&self) -> SlotContext
fn clone(&self) -> SlotContext
Returns a duplicate 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 moreSource§impl Debug for SlotContext
impl Debug for SlotContext
Source§impl Default for SlotContext
impl Default for SlotContext
Source§fn default() -> SlotContext
fn default() -> SlotContext
Returns the “default value” for a type. Read more
impl Copy for SlotContext
Auto Trait Implementations§
impl Freeze for SlotContext
impl RefUnwindSafe for SlotContext
impl Send for SlotContext
impl Sync for SlotContext
impl Unpin 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