pub struct SharedCostPermit<'state, 'request, 'fingerprint> { /* private fields */ }Expand description
Shared atomic price-bounded authority.
Every clone references the same caller-owned atomic state. Cloning never creates new budget or an independent recovery generation.
Implementations§
Sourcepub fn new(
state: &'state mut SharedPermitState,
subject: PlanSubject<'request, 'fingerprint>,
now: PermitTimestamp,
) -> Result<Self, ExecutionPermitError>
pub fn new( state: &'state mut SharedPermitState, subject: PlanSubject<'request, 'fingerprint>, now: PermitTimestamp, ) -> Result<Self, ExecutionPermitError>
Exclusively binds fresh shared state to one confirmed plan.
Sourcepub fn state(&self) -> PermitState
pub fn state(&self) -> PermitState
Returns the shared lifecycle state.
Sourcepub fn begin(
&self,
now: PermitTimestamp,
) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
pub fn begin( &self, now: PermitTimestamp, ) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
Atomically starts one attempt for the bound plan.
Sourcepub fn begin_for(
&self,
candidate: PlanSubject<'_, '_>,
now: PermitTimestamp,
) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
pub fn begin_for( &self, candidate: PlanSubject<'_, '_>, now: PermitTimestamp, ) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
Starts only if the candidate fingerprint matches the bound plan.
Sourcepub fn recover_not_sent(
&self,
token: RecoveryToken,
now: PermitTimestamp,
) -> Result<(), ExecutionPermitError>
pub fn recover_not_sent( &self, token: RecoveryToken, now: PermitTimestamp, ) -> Result<(), ExecutionPermitError>
Atomically recovers a generation-matched NotSent attempt.
Sourcepub fn reconcile_not_applied(
&self,
token: ReconciliationToken,
candidate: PlanSubject<'_, '_>,
idempotency: PermitIdempotencyKey<'_>,
now: PermitTimestamp,
) -> Result<(), ExecutionPermitError>
pub fn reconcile_not_applied( &self, token: ReconciliationToken, candidate: PlanSubject<'_, '_>, idempotency: PermitIdempotencyKey<'_>, now: PermitTimestamp, ) -> Result<(), ExecutionPermitError>
Rearms after caller-performed operation-specific reconciliation.
Trait Implementations§
Auto Trait Implementations§
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