Skip to main content

PermitAttempt

Struct PermitAttempt 

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

One in-flight attempt. Dropping it records uncertain delivery.

The prepared request cannot be extracted from this capability.

use cloud_sdk::operation::PermitAttempt;

fn extract(attempt: &PermitAttempt<'_, '_, '_>) {
    let _ = attempt.prepared();
}

Implementations§

Source§

impl<'permit, 'request, 'fingerprint> PermitAttempt<'permit, 'request, 'fingerprint>

Source

pub fn complete(self, phase: DeliveryPhase) -> PermitDisposition

Completes a manually driven attempt with conservative delivery state.

NotSent is sound only when a delivery-aware transport boundary proves that no request bytes reached the peer. Unknown state must be reported as PossiblySent; ordinary callers should prefer the execute methods.

Source

pub fn complete_applied(self) -> PermitDisposition

Marks a successful checked provider response and spends authority.

Source

pub fn execute_blocking<'buffer, T, C>( self, clock: &C, transport: &T, response_storage: &'buffer mut [u8], response_header_storage: &'buffer mut [u8], ) -> Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>

Executes once through a delivery-classified blocking transport.

Source

pub async fn execute_async<'transport, 'buffer, T, C>( self, clock: &'transport C, transport: &'transport T, response_storage: &'buffer mut [u8], response_header_storage: &'buffer mut [u8], ) -> Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>
where T: AsyncAuthenticatedTransport + BoundTransport, T::Error: DeliveryClassified, C: PermitClock + Sync + ?Sized, 'request: 'transport, 'permit: 'transport,

Executes once through a delivery-classified Send-async transport.

Source

pub async fn execute_local_async<'transport, 'buffer, T, C>( self, clock: &'transport C, transport: &'transport T, response_storage: &'buffer mut [u8], response_header_storage: &'buffer mut [u8], ) -> Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>
where T: LocalAsyncAuthenticatedTransport + BoundTransport, T::Error: DeliveryClassified, C: PermitClock + ?Sized, 'request: 'transport, 'permit: 'transport,

Executes once through a delivery-classified local-async transport.

Trait Implementations§

Source§

impl Debug for PermitAttempt<'_, '_, '_>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for PermitAttempt<'_, '_, '_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'permit, 'request, 'fingerprint> !UnwindSafe for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> Freeze for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> RefUnwindSafe for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> Send for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> Sync for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> Unpin for PermitAttempt<'permit, 'request, 'fingerprint>

§

impl<'permit, 'request, 'fingerprint> UnsafeUnpin for PermitAttempt<'permit, '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.