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>
impl<'permit, 'request, 'fingerprint> PermitAttempt<'permit, 'request, 'fingerprint>
Sourcepub fn complete(self, phase: DeliveryPhase) -> PermitDisposition
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.
Sourcepub fn complete_applied(self) -> PermitDisposition
pub fn complete_applied(self) -> PermitDisposition
Marks a successful checked provider response and spends authority.
Rejects this in-flight attempt before transport dispatch.
Provider wrappers use this after validating request-bound evidence with the same clock sample supplied to the generic permit check.
Sourcepub 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>>where
T: BlockingAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + ?Sized,
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>>where
T: BlockingAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + ?Sized,
Executes once through a delivery-classified blocking transport.
Sourcepub 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],
) -> impl Future<Output = Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>> + 'transportwhere
T: AsyncAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + Sync + ?Sized,
'request: 'transport,
'permit: 'transport,
'buffer: 'transport,
pub 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],
) -> impl Future<Output = Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>> + 'transportwhere
T: AsyncAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + Sync + ?Sized,
'request: 'transport,
'permit: 'transport,
'buffer: 'transport,
Executes once through a delivery-classified Send-async transport.
Sourcepub 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],
) -> impl Future<Output = Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>> + 'transportwhere
T: LocalAsyncAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + ?Sized,
'request: 'transport,
'permit: 'transport,
'buffer: 'transport,
pub 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],
) -> impl Future<Output = Result<CheckedResponseGuard<'buffer>, PermitExecutionError<T::Error>>> + 'transportwhere
T: LocalAsyncAuthenticatedTransport + BoundTransport,
T::Error: DeliveryClassified,
C: PermitClock + ?Sized,
'request: 'transport,
'permit: 'transport,
'buffer: 'transport,
Executes once through a delivery-classified local-async transport.