Skip to main content

LeaveOnlyEdge

Trait LeaveOnlyEdge 

Source
pub trait LeaveOnlyEdge:
    Sealed
    + Sized
    + Copy {
    // Required methods
    fn participant_id(self) -> ParticipantId;
    fn validate_leave_claim(
        &self,
        participant_id: ParticipantId,
        actual_charge: ResourceVector,
        remaining_k: ResourceVector,
        exit_claims: u64,
    ) -> Option<KClaimBackedDetachedLeave>;
    fn leave(
        self,
        debt: ClosureDebt,
        event: Event,
        evidence: KClaimBackedDetachedLeave,
        successor: DebtCompletion,
    ) -> Result<ClosureState, ClosureState>;
    fn repeat_fate(self, event: Event) -> Result<Self, Self>;
    fn unrelated_event(
        self,
        debt: ClosureDebt,
        event: Event,
        resulting_debt: Option<ClosureDebt>,
    ) -> Result<ClosureState, ClosureState>;

    // Provided methods
    fn authority_superseded(self) -> (Self, DetachedAttachRefusal) { ... }
    fn binding_required_refusal(self) -> DetachedAttachRefusal { ... }
}
Expand description

Sealed intended-dead-end contract for DMR and DCursor.

Required Methods§

Source

fn participant_id(self) -> ParticipantId

Returns the exact owner of this Leave-only edge.

Source

fn validate_leave_claim( &self, participant_id: ParticipantId, actual_charge: ResourceVector, remaining_k: ResourceVector, exit_claims: u64, ) -> Option<KClaimBackedDetachedLeave>

Validates participant, exact target, actual charge, remaining K, and the available exit claim before creating private Leave authority.

Source

fn leave( self, debt: ClosureDebt, event: Event, evidence: KClaimBackedDetachedLeave, successor: DebtCompletion, ) -> Result<ClosureState, ClosureState>

Sole successful owner transition: exact-current K-backed detached Leave.

§Errors

Returns the unchanged owed state unless the Leave and private claim authority both name this exact Leave-only edge.

Source

fn repeat_fate(self, event: Event) -> Result<Self, Self>

Repeat exact fate is an event-consuming no-op.

§Errors

Returns the unchanged edge when the event is not fate for its exact owner and last dead binding epoch.

Source

fn unrelated_event( self, debt: ClosureDebt, event: Event, resulting_debt: Option<ClosureDebt>, ) -> Result<ClosureState, ClosureState>

Applies an unrelated participant event, preserving this edge while debt remains or clearing it with debt.

§Errors

Returns the unchanged owed state for a non-participant event or an event owned by this detached participant.

Provided Methods§

Source

fn authority_superseded(self) -> (Self, DetachedAttachRefusal)

Supersession is stale and preserves the exact edge.

Source

fn binding_required_refusal(self) -> DetachedAttachRefusal

Normal/marker ack and ordinary admission have no binding authority.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§