Skip to main content

AppendReceipt

Struct AppendReceipt 

Source
pub struct AppendReceipt { /* private fields */ }
Expand description

Canonical receipt for one primary-log append attempt.

Implementations§

Source§

impl AppendReceipt

Source

pub fn try_new( status: AppendStatus, appended_range: Range<i64>, appended_watermark: i64, durable_watermark: i64, durability: Durability, ) -> Result<Self, StoreContractViolation>

Creates a receipt after validating range, status, watermark, and durability invariants.

§Errors

Returns StoreContractViolation when any receipt field contradicts another field.

Source

pub fn try_new_with_replication( status: AppendStatus, appended_range: Range<i64>, appended_watermark: i64, durable_watermark: i64, acknowledgement: ReplicationAcknowledgement, ) -> Result<Self, StoreContractViolation>

Creates a receipt from a proof produced by decide_replication.

§Errors

Returns StoreContractViolation when receipt fields contradict each other or the supplied acknowledgement does not cover the complete appended range.

Source

pub const fn try_rejected( status: AppendStatus, appended_watermark: i64, durable_watermark: i64, ) -> Result<Self, StoreContractViolation>

Creates a rejected receipt after validating status and watermark invariants.

§Errors

Returns StoreContractViolation for an accepted status or reversed progress watermarks.

Source

pub const fn status(&self) -> AppendStatus

Returns the neutral append outcome.

Source

pub fn appended_range(&self) -> Option<Range<i64>>

Returns the half-open physical range written by this operation.

Source

pub fn first_appended_offset(&self) -> Option<i64>

Returns the first physical byte appended by this operation.

Source

pub fn last_appended_offset(&self) -> Option<i64>

Returns the last physical byte appended by this operation.

Source

pub const fn appended_watermark(&self) -> i64

Returns the exclusive primary-log append watermark observed after the operation.

Source

pub const fn durable_watermark(&self) -> i64

Returns the exclusive durable watermark observed after the operation.

Source

pub const fn durability(&self) -> Durability

Returns the explicitly reached durability level.

Source

pub fn is_accepted(&self) -> bool

Returns whether the primary log accepted a non-empty appended range.

Source

pub fn is_durable(&self) -> bool

Returns whether the complete appended range reached the reported durable watermark.

Trait Implementations§

Source§

impl Clone for AppendReceipt

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppendReceipt

Source§

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

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

impl Eq for AppendReceipt

Source§

impl PartialEq for AppendReceipt

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AppendReceipt

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.