pub struct CostPermit<'request, 'fingerprint> { /* private fields */ }Expand description
Single-owner authority for one exact price-bounded cost plan.
This authority is intentionally neither Copy nor Clone.
ⓘ
use cloud_sdk::operation::CostPermit;
fn clone_authority(value: CostPermit<'_, '_>) { let _ = value.clone(); }ⓘ
use cloud_sdk::operation::CostPermit;
fn copy_authority(value: CostPermit<'_, '_>) { let _first = value; let _second = value; }Implementations§
Source§impl<'request, 'fingerprint> CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> CostPermit<'request, 'fingerprint>
Sourcepub fn new(
subject: PlanSubject<'request, 'fingerprint>,
now: PermitTimestamp,
) -> Result<Self, ExecutionPermitError>
pub fn new( subject: PlanSubject<'request, 'fingerprint>, now: PermitTimestamp, ) -> Result<Self, ExecutionPermitError>
Creates one direct authority for an exact confirmed plan.
Sourcepub const fn state(&self) -> PermitState
pub const fn state(&self) -> PermitState
Returns the current fail-closed lifecycle state.
Sourcepub fn begin(
&mut self,
now: PermitTimestamp,
) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
pub fn begin( &mut self, now: PermitTimestamp, ) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
Starts one attempt for the originally confirmed request.
Sourcepub fn begin_for(
&mut self,
subject: PlanSubject<'_, '_>,
now: PermitTimestamp,
) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
pub fn begin_for( &mut self, subject: PlanSubject<'_, '_>, now: PermitTimestamp, ) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>
Starts one attempt only if a supplied plan still matches exactly.
Sourcepub fn recover_not_sent(
&mut self,
token: RecoveryToken,
now: PermitTimestamp,
) -> Result<(), ExecutionPermitError>
pub fn recover_not_sent( &mut self, token: RecoveryToken, now: PermitTimestamp, ) -> Result<(), ExecutionPermitError>
Rearms authority after a generation-matched NotSent result.
Sourcepub fn reconcile_not_applied(
&mut self,
token: ReconciliationToken,
subject: PlanSubject<'_, '_>,
idempotency: PermitIdempotencyKey<'_>,
now: PermitTimestamp,
) -> Result<(), ExecutionPermitError>
pub fn reconcile_not_applied( &mut self, token: ReconciliationToken, subject: PlanSubject<'_, '_>, idempotency: PermitIdempotencyKey<'_>, now: PermitTimestamp, ) -> Result<(), ExecutionPermitError>
Rearms after caller-performed operation-specific reconciliation.
Callers must invoke this only after proving that the provider did not apply the uncertain attempt. The exact plan and idempotency identity are rechecked before authority becomes ready.
Trait Implementations§
Auto Trait Implementations§
impl<'request, 'fingerprint> Freeze for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> RefUnwindSafe for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> Send for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> Sync for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> Unpin for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> UnsafeUnpin for CostPermit<'request, 'fingerprint>
impl<'request, 'fingerprint> UnwindSafe for CostPermit<'request, 'fingerprint>
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