Skip to main content

MutationPermit

Struct MutationPermit 

Source
pub struct MutationPermit<'request, 'fingerprint> { /* private fields */ }
Expand description

Single-owner authority for one non-destructive mutation plan.

This authority is intentionally neither Copy nor Clone.

use cloud_sdk::operation::MutationPermit;
fn clone_authority(value: MutationPermit<'_, '_>) { let _ = value.clone(); }
use cloud_sdk::operation::MutationPermit;
fn copy_authority(value: MutationPermit<'_, '_>) { let _first = value; let _second = value; }

Implementations§

Source§

impl<'request, 'fingerprint> MutationPermit<'request, 'fingerprint>

Source

pub fn new( subject: PlanSubject<'request, 'fingerprint>, now: PermitTimestamp, ) -> Result<Self, ExecutionPermitError>

Creates one direct authority for an exact confirmed plan.

Source

pub const fn state(&self) -> PermitState

Returns the current fail-closed lifecycle state.

Source

pub fn begin( &mut self, now: PermitTimestamp, ) -> Result<PermitAttempt<'_, 'request, 'fingerprint>, ExecutionPermitError>

Starts one attempt for the originally confirmed request.

Source

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.

Source

pub fn recover_not_sent( &mut self, token: RecoveryToken, now: PermitTimestamp, ) -> Result<(), ExecutionPermitError>

Rearms authority after a generation-matched NotSent result.

Source

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§

Source§

impl Debug for MutationPermit<'_, '_>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'request, 'fingerprint> Freeze for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> RefUnwindSafe for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> Send for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> Sync for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> Unpin for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> UnsafeUnpin for MutationPermit<'request, 'fingerprint>

§

impl<'request, 'fingerprint> UnwindSafe for MutationPermit<'request, 'fingerprint>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.