pub enum ParticipantCursorProgress {
Continuous(CursorProgressContinuous),
Marker(CursorProgressMarker),
}Expand description
Cursor progress split into typestates rather than an optional marker bag.
Continuous construction is crate-private so matching raw participant and
epoch values cannot fabricate DetachedCursorRelease authority.
use liminal_protocol::{
lifecycle::ParticipantCursorProgress,
wire::BindingEpoch,
};
fn fabricate(epoch: BindingEpoch) {
let _ = ParticipantCursorProgress::continuous(7, epoch, 11);
}Variants§
Continuous(CursorProgressContinuous)
Continuous cursor witness.
Marker(CursorProgressMarker)
Exact marker acknowledgement witness, derivable only from delivery.
Implementations§
Source§impl ParticipantCursorProgress
impl ParticipantCursorProgress
Sourcepub const fn participant_id(self) -> ParticipantId
pub const fn participant_id(self) -> ParticipantId
Returns the participant whose cursor is required.
Sourcepub const fn binding_epoch(self) -> BindingEpoch
pub const fn binding_epoch(self) -> BindingEpoch
Returns the exact binding epoch.
Sourcepub const fn through_seq(self) -> DeliverySeq
pub const fn through_seq(self) -> DeliverySeq
Returns the required cumulative boundary.
Sourcepub const fn marker_delivery_seq(self) -> Option<DeliverySeq>
pub const fn marker_delivery_seq(self) -> Option<DeliverySeq>
Returns the exact delivered marker when this is marker-backed.
Source§impl ParticipantCursorProgress
impl ParticipantCursorProgress
Sourcepub fn complete_ack(
self,
debt: ClosureDebt,
event: Event,
successor: DebtCompletion,
) -> Result<ClosureState, ClosureState>
pub fn complete_ack( self, debt: ClosureDebt, event: Event, successor: DebtCompletion, ) -> Result<ClosureState, ClosureState>
Consumes an equal normal ack or exact marker ack and selects only clear/OP/PC.
§Errors
Returns the unchanged owed state unless the ack kind, participant, epoch, and boundary exactly satisfy this cursor witness.
Sourcepub fn lesser_ack(
self,
debt: ClosureDebt,
event: Event,
resulting_debt: ClosureDebt,
) -> Result<ClosureState, ClosureState>
pub fn lesser_ack( self, debt: ClosureDebt, event: Event, resulting_debt: ClosureDebt, ) -> Result<ClosureState, ClosureState>
Consumes a lesser advancing normal ack and preserves this exact PCP.
§Errors
Returns the unchanged owed state unless the event is a matching current- epoch normal ack strictly below the stored boundary.
Sourcepub fn clear_after_greater_ack(
&self,
event: &Event,
) -> Option<ProjectionCompactionSuccessor>
pub fn clear_after_greater_ack( &self, event: &Event, ) -> Option<ProjectionCompactionSuccessor>
Validates clear selection for one greater cumulative normal ack.
Sourcepub fn strict_after_greater_ack(
&self,
event: &Event,
debt: ClosureDebt,
edge: StoredEdge,
successor_boundary: DeliverySeq,
) -> Option<ProjectionCompactionSuccessor>
pub fn strict_after_greater_ack( &self, event: &Event, debt: ClosureDebt, edge: StoredEdge, successor_boundary: DeliverySeq, ) -> Option<ProjectionCompactionSuccessor>
Validates a strict non-DCR suffix for one greater cumulative normal ack.
Sourcepub fn greater_ack(
self,
debt: ClosureDebt,
event: Event,
successor: ProjectionCompactionSuccessor,
) -> Result<ClosureState, ClosureState>
pub fn greater_ack( self, debt: ClosureDebt, event: Event, successor: ProjectionCompactionSuccessor, ) -> Result<ClosureState, ClosureState>
Consumes a greater cumulative normal ack and its predecessor-bound suffix.
§Errors
Returns the unchanged owed state unless the advancing event and strict successor authority are both bound to this cursor witness.
Sourcepub const fn unchanged(self, debt: ClosureDebt) -> ClosureState
pub const fn unchanged(self, debt: ClosureDebt) -> ClosureState
No-op, AckGap, and AckRegression consume no event and preserve exact PCP.
Sourcepub const fn storage_progress(
self,
debt: ClosureDebt,
event: Event,
resulting_debt: Option<ClosureDebt>,
) -> Result<ClosureState, ClosureState>
pub const fn storage_progress( self, debt: ClosureDebt, event: Event, resulting_debt: Option<ClosureDebt>, ) -> Result<ClosureState, ClosureState>
Consumes independent projection/compaction completion and preserves PCP while debt remains, or clears it. Compaction cannot cross an unaccepted marker anchor.
§Errors
Returns the unchanged owed state for another event class or for a compaction that reaches an unaccepted marker.
Sourcepub fn binding_fate(
self,
debt: ClosureDebt,
event: Event,
) -> Result<CursorFateSuccessor, ClosureState>
pub fn binding_fate( self, debt: ClosureDebt, event: Event, ) -> Result<CursorFateSuccessor, ClosureState>
Consumes exact binding fate and derives DCR only from marker-backed PCP.
Continuous PCP never accepts this raw-event transition. Ordinary
no-marker fate requires OrdinaryBindingAuthority, while the fate of
an epoch committed by fenced attach requires
FencedAttachCommit::recovered_binding_fate.
§Errors
Returns the unchanged owed state unless fate names the exact participant and binding epoch carried by this cursor witness.
Sourcepub const fn retarget(
self,
new_binding_epoch: BindingEpoch,
episode_churn_used: u64,
delta_cycles: u64,
episode_churn_limit: u64,
) -> Result<Self, (Self, DetachedAttachRefusal)>
pub const fn retarget( self, new_binding_epoch: BindingEpoch, episode_churn_used: u64, delta_cycles: u64, episode_churn_limit: u64, ) -> Result<Self, (Self, DetachedAttachRefusal)>
Retargets only continuous PCP after exact charged supersession.
§Errors
Returns the unchanged cursor and the exact delivered-marker, churn, or stale-authority refusal when retargeting is forbidden.
Sourcepub fn leave(
self,
debt: ClosureDebt,
event: Event,
successor: DebtCompletion,
) -> Result<ClosureState, ClosureState>
pub fn leave( self, debt: ClosureDebt, event: Event, successor: DebtCompletion, ) -> Result<ClosureState, ClosureState>
Consumes exact live Leave and installs its measured clear/OP/PC result.
§Errors
Returns the unchanged owed state unless Leave names the exact live participant and binding epoch.
Trait Implementations§
Source§impl Clone for ParticipantCursorProgress
impl Clone for ParticipantCursorProgress
Source§fn clone(&self) -> ParticipantCursorProgress
fn clone(&self) -> ParticipantCursorProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more