Skip to main content

AttemptJournalGuard

Struct AttemptJournalGuard 

Source
pub struct AttemptJournalGuard<'a> { /* private fields */ }
Expand description

Exclusive local accounting borrowing stable layout exclusion.

Successful reservation persists consumption before returning its number. It grants no fresh IC authority, backend settlement or subprocess dispatch permission.

Implementations§

Source§

impl<'a> AttemptJournalGuard<'a>

Source

pub fn create( layout: &'a BackupLayoutGuard, authority: AttemptAuthorityRecord, ) -> Result<Self, AttemptJournalError>

Create original exact identity and limits without replacing retained evidence.

§Errors

Rejects unsafe/existing journals, lock contention, replaced layouts and failed persistence.

Source

pub fn open( layout: &'a BackupLayoutGuard, expected: &AttemptAuthorityRecord, ) -> Result<Self, AttemptJournalError>

Open exact retained identity and original budgets, replaying only local events.

§Errors

Rejects identity/budget changes, invalid chronology, missing/unsafe/oversized records and locks.

Source

pub fn record(&self) -> Result<&AttemptJournalRecord, AttemptJournalError>

Read validated retained accounting without observing remote state.

§Errors

Rejects indeterminate writes or replaced layouts.

Source

pub fn path(&self) -> PathBuf

Return the exact journal location for this operation sequence.

Source

pub fn reserve_mutation(&mut self) -> Result<u32, AttemptJournalError>

Durably consume one mutation attempt before any admitted caller-owned call.

§Errors

Rejects unresolved attempts, exhaustion, applied operations and persistence failures.

Source

pub fn reserve_observation( &mut self, mutation: u32, request: &str, ) -> Result<u32, AttemptJournalError>

Durably consume one observation bound to an exact unresolved mutation and request.

Fresh authority, paid-effect settlement and ended command custody remain caller-owned.

§Errors

Rejects wrong attempts/requests, unresolved observations, exhaustion and failed writes.

Source

pub fn record_mutation( &mut self, receipt: MutationReceiptRequest, ) -> Result<(), AttemptJournalError>

Retain an exact integration-qualified direct mutation reply.

§Errors

Rejects unmatched identity, absent/unsettled attempts, invalid evidence and failed persistence.

Source

pub fn record_observation( &mut self, receipt: ObservationReceiptRequest, ) -> Result<(), AttemptJournalError>

Retain an exact observation; unresolved evidence never authorizes another mutation.

The integration qualifies completed observation and paid-effect settlement. A lost observation response stays pending until qualified settlement.

§Errors

Rejects unmatched identity, absent/unsettled attempts, invalid evidence and failed persistence.

Trait Implementations§

Source§

impl<'a> Debug for AttemptJournalGuard<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.