pub struct SlotTracker { /* private fields */ }Expand description
Tracks the last processed slot for stream resumption after reconnection.
Includes a Notify that wakes waiters whenever the slot advances,
allowing the scheduler to react immediately to new slots instead of polling.
Also maintains a cache of slot hashes indexed by slot number.
Implementations§
Source§impl SlotTracker
impl SlotTracker
pub fn new() -> Self
pub fn record(&self, slot: u64)
Sourcepub async fn record_slot_hash(&self, slot: u64, slot_hash: String)
pub async fn record_slot_hash(&self, slot: u64, slot_hash: String)
Record a slot hash for a specific slot
Sourcepub async fn get_slot_hash(&self, slot: u64) -> Option<String>
pub async fn get_slot_hash(&self, slot: u64) -> Option<String>
Get the slot hash for a specific slot (if cached)
pub fn get(&self) -> u64
Trait Implementations§
Source§impl Clone for SlotTracker
impl Clone for SlotTracker
Source§fn clone(&self) -> SlotTracker
fn clone(&self) -> SlotTracker
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 moreAuto Trait Implementations§
impl Freeze for SlotTracker
impl !RefUnwindSafe for SlotTracker
impl Send for SlotTracker
impl Sync for SlotTracker
impl Unpin for SlotTracker
impl UnsafeUnpin for SlotTracker
impl !UnwindSafe for SlotTracker
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