pub struct CompletionCursor {
pub epoch: FencingToken,
pub turns: u64,
}Expand description
Comparable completion identity for one identity’s stream of turns.
Waiting for an agent’s next answer must never compare output TEXT. Two
consecutive turns can legitimately produce byte-identical output (ACK
twice is the production case that produced a phantom 962-second turn), and
a text comparison then reports “no new turn” for the whole configured wait.
This cursor is the comparable atom instead. It is never derived from output
content, a content hash, a wall-clock timestamp, or a uuid regenerated per
poll.
epoch is the identity’s lease FencingToken — the runtime-incarnation
atom the LeaseProvider already issues, and which the bundled provider
resumes strictly above the continuity store’s persisted high-water mark so
it keeps advancing across process restarts. turns counts turns observed
as completed within that incarnation.
Ordering is lexicographic (epoch, then turns), so the pair never
regresses: a fresh incarnation always sorts above every cursor the previous
one published. Turn counts are NOT comparable across incarnations, which is
why callers classify with Self::progress_since rather than a bare >
— an incarnation change is reported, not silently read as progress.
Fields§
§epoch: FencingTokenLease incarnation this count belongs to.
turns: u64Turns observed as completed within epoch.
Implementations§
Source§impl CompletionCursor
impl CompletionCursor
Sourcepub const fn start(epoch: FencingToken) -> Self
pub const fn start(epoch: FencingToken) -> Self
The zero cursor for epoch: no completed turn observed yet.
pub const fn new(epoch: FencingToken, turns: u64) -> Self
Sourcepub const fn rebased(self, epoch: FencingToken) -> Self
pub const fn rebased(self, epoch: FencingToken) -> Self
Re-anchor onto epoch when the identity’s lease incarnation moved on.
A stale or equal epoch leaves the cursor untouched, so a caller presenting an older token can never rewind what has been published.
Sourcepub const fn progress_since(self, baseline: Self) -> CompletionProgress
pub const fn progress_since(self, baseline: Self) -> CompletionProgress
Classify this cursor against a baseline captured before a delivery.
Trait Implementations§
Source§impl Clone for CompletionCursor
impl Clone for CompletionCursor
Source§fn clone(&self) -> CompletionCursor
fn clone(&self) -> CompletionCursor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompletionCursor
Source§impl Debug for CompletionCursor
impl Debug for CompletionCursor
Source§impl Default for CompletionCursor
impl Default for CompletionCursor
Source§impl<'de> Deserialize<'de> for CompletionCursor
impl<'de> Deserialize<'de> for CompletionCursor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CompletionCursor
impl Display for CompletionCursor
impl Eq for CompletionCursor
Source§impl Hash for CompletionCursor
impl Hash for CompletionCursor
Source§impl Ord for CompletionCursor
impl Ord for CompletionCursor
Source§fn cmp(&self, other: &CompletionCursor) -> Ordering
fn cmp(&self, other: &CompletionCursor) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CompletionCursor
impl PartialEq for CompletionCursor
Source§impl PartialOrd for CompletionCursor
impl PartialOrd for CompletionCursor
Source§impl Serialize for CompletionCursor
impl Serialize for CompletionCursor
impl StructuralPartialEq for CompletionCursor
Auto Trait Implementations§
impl Freeze for CompletionCursor
impl RefUnwindSafe for CompletionCursor
impl Send for CompletionCursor
impl Sync for CompletionCursor
impl Unpin for CompletionCursor
impl UnsafeUnpin for CompletionCursor
impl UnwindSafe for CompletionCursor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> CoreExecutorTurnFinalizationGuard for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more