pub struct AppendReceipt { /* private fields */ }Expand description
Canonical receipt for one primary-log append attempt.
Implementations§
Source§impl AppendReceipt
impl AppendReceipt
Sourcepub fn try_new(
status: AppendStatus,
appended_range: Range<i64>,
appended_watermark: i64,
durable_watermark: i64,
durability: Durability,
) -> Result<Self, StoreContractViolation>
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.
Sourcepub fn try_new_with_replication(
status: AppendStatus,
appended_range: Range<i64>,
appended_watermark: i64,
durable_watermark: i64,
acknowledgement: ReplicationAcknowledgement,
) -> Result<Self, StoreContractViolation>
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.
Sourcepub const fn try_rejected(
status: AppendStatus,
appended_watermark: i64,
durable_watermark: i64,
) -> Result<Self, StoreContractViolation>
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.
Sourcepub const fn status(&self) -> AppendStatus
pub const fn status(&self) -> AppendStatus
Returns the neutral append outcome.
Sourcepub fn appended_range(&self) -> Option<Range<i64>>
pub fn appended_range(&self) -> Option<Range<i64>>
Returns the half-open physical range written by this operation.
Sourcepub fn first_appended_offset(&self) -> Option<i64>
pub fn first_appended_offset(&self) -> Option<i64>
Returns the first physical byte appended by this operation.
Sourcepub fn last_appended_offset(&self) -> Option<i64>
pub fn last_appended_offset(&self) -> Option<i64>
Returns the last physical byte appended by this operation.
Sourcepub const fn appended_watermark(&self) -> i64
pub const fn appended_watermark(&self) -> i64
Returns the exclusive primary-log append watermark observed after the operation.
Sourcepub const fn durable_watermark(&self) -> i64
pub const fn durable_watermark(&self) -> i64
Returns the exclusive durable watermark observed after the operation.
Sourcepub const fn durability(&self) -> Durability
pub const fn durability(&self) -> Durability
Returns the explicitly reached durability level.
Sourcepub fn is_accepted(&self) -> bool
pub fn is_accepted(&self) -> bool
Returns whether the primary log accepted a non-empty appended range.
Sourcepub fn is_durable(&self) -> bool
pub fn is_durable(&self) -> bool
Returns whether the complete appended range reached the reported durable watermark.