pub struct Append {
pub run: RunId,
pub case: Option<CaseId>,
pub step: Option<StepId>,
pub phase: Phase,
pub effect_key: Option<EffectKey>,
pub kind: RecordKind,
/* private fields */
}Expand description
What the runtime hands the store. Seq, chain links, and hashing are the store’s job, because only it knows the run’s current head.
Fields§
§run: RunId§case: Option<CaseId>§step: Option<StepId>§phase: Phase§effect_key: Option<EffectKey>§kind: RecordKindImplementations§
Source§impl Append
impl Append
pub fn new(run: RunId, kind: RecordKind) -> Self
pub fn step(self, s: StepId) -> Self
pub fn phase(self, p: Phase) -> Self
pub fn case(self, c: CaseId) -> Self
pub fn effect(self, k: EffectKey) -> Self
Sourcepub fn from_body(body: RecordBody) -> Self
pub fn from_body(body: RecordBody) -> Self
Rebuild the append that produced a body.
The inverse of the crate-private into_body, and the whole of what a
restore needs: seq and epoch are supplied by the write path, and
everything else travels here. Written as a function rather than left to
each caller because the field list is the thing that would drift — a
restore that forgot phase would replay a compensation as a forward
record, and the chain would hash differently for a reason no diff shows.
Ungated, unlike into_body below: a restore reads an export rather than
a store, so it is reachable in a build with no backend compiled in.
Sourcepub fn restored(record: Record) -> Self
pub fn restored(record: Record) -> Self
The append that puts a verified record back exactly as it was written.
The store stores and hashes the bytes the record carries and indexes the body it reads from those bytes through its own upcaster — never the append’s fields, which a caller can change after this — so a record restored across a shape change hashes as it did in the export. A body re-sealed instead would be this build’s serialization of the lifted shape: new bytes, a new hash, and a chain that is no longer the one exported.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Append
impl RefUnwindSafe for Append
impl Send for Append
impl Sync for Append
impl Unpin for Append
impl UnsafeUnpin for Append
impl UnwindSafe for Append
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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