#[non_exhaustive]pub enum ProgressWrite {
Rebase {
anchor: BuyerLaneProgress,
totals: BuyerLaneProgress,
},
Advance {
totals: BuyerLaneProgress,
},
}Expand description
The buyer-store write that records one lane’s VoucherProgress, so a later
reuse or a restart resumes the lane at the right cumulative bytes /
amount.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rebase
The lane’s ledger rebased to the upstream’s authenticated watermark
anchor, behind the record on amount (PoolLedger::rebase), and no write has recorded it yet. The
record is overwritten with anchor and then advanced to totals. A
monotone advance refuses a lower total, and the next reuse would then sign
from the anchor the upstream already refused.
Fields
anchor: BuyerLaneProgressThe upstream watermark the ledger rebased to.
totals: BuyerLaneProgressThe lane’s cumulative totals after the rebase.
Advance
A monotone advance to totals.
Fields
totals: BuyerLaneProgressThe lane’s new cumulative totals.
Implementations§
Source§impl ProgressWrite
impl ProgressWrite
Sourcepub fn of(progress: &VoucherProgress) -> Option<Self>
pub fn of(progress: &VoucherProgress) -> Option<Self>
The write progress calls for, or None when it neither advanced past
its seed nor carries a rebase anchor. A pending anchor is written even
when the totals did not advance: the write exists to move the record
down.
Sourcepub const fn totals(&self) -> BuyerLaneProgress
pub const fn totals(&self) -> BuyerLaneProgress
The lane’s cumulative totals after this write.
Sourcepub fn apply<S: BuyerPoolStore + ?Sized>(
&self,
store: &S,
owner: Address,
pool_id: PoolId,
lane: LaneKey,
) -> Result<AdvanceOutcome, StoreError>
pub fn apply<S: BuyerPoolStore + ?Sized>( &self, store: &S, owner: Address, pool_id: PoolId, lane: LaneKey, ) -> Result<AdvanceOutcome, StoreError>
Apply this write to lane inside owner’s pool pool_id.
§Errors
Returns a StoreError only on a backend or codec fault. A write the
store declines (an unknown or replaced pool, a regression) is the Ok
AdvanceOutcome.
Trait Implementations§
Source§impl Clone for ProgressWrite
impl Clone for ProgressWrite
impl Copy for ProgressWrite
Source§impl Debug for ProgressWrite
impl Debug for ProgressWrite
impl Eq for ProgressWrite
Source§impl PartialEq for ProgressWrite
impl PartialEq for ProgressWrite
impl StructuralPartialEq for ProgressWrite
Auto Trait Implementations§
impl Freeze for ProgressWrite
impl RefUnwindSafe for ProgressWrite
impl Send for ProgressWrite
impl Sync for ProgressWrite
impl Unpin for ProgressWrite
impl UnsafeUnpin for ProgressWrite
impl UnwindSafe for ProgressWrite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more