pub struct SequenceCounter(/* private fields */);Expand description
Monotonically increasing per-run counter for event ordering.
Each run() or run_turn() call creates a fresh counter starting at 0.
The counter is Arc-wrapped so it can be shared across tasks (e.g., subagent
progress events sent from child tokio tasks).
Ordering::Relaxed is sufficient because the mpsc channel provides the
happens-before ordering guarantee between sender and receiver.
Implementations§
Source§impl SequenceCounter
impl SequenceCounter
Sourcepub fn new() -> SequenceCounter
pub fn new() -> SequenceCounter
Create a new counter starting at 0.
Sourcepub fn with_offset(start: u64) -> SequenceCounter
pub fn with_offset(start: u64) -> SequenceCounter
Create a counter starting at the given offset.
Used by server mode to resume sequencing across turns within the same thread — the server seeds the counter with the last known sequence value so numbering is continuous.
Trait Implementations§
Source§impl Clone for SequenceCounter
impl Clone for SequenceCounter
Source§fn clone(&self) -> SequenceCounter
fn clone(&self) -> SequenceCounter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SequenceCounter
impl Debug for SequenceCounter
Source§impl Default for SequenceCounter
impl Default for SequenceCounter
Source§fn default() -> SequenceCounter
fn default() -> SequenceCounter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SequenceCounter
impl RefUnwindSafe for SequenceCounter
impl Send for SequenceCounter
impl Sync for SequenceCounter
impl Unpin for SequenceCounter
impl UnsafeUnpin for SequenceCounter
impl UnwindSafe for SequenceCounter
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