pub enum KernelPreparation<Record, Step> {
Prepared(PreparedTransition<Record, Step>),
Replayed(ReplayedTransition<Record, Step>),
Rejected(RejectedTransition),
}Expand description
The result of preparing one input.
Generic over the durable record and the planned step: Task 6 owns those two contracts, and this task fixes only the shape of the result — which arms exist, and what each may carry.
Variants§
Prepared(PreparedTransition<Record, Step>)
A new record was built and is waiting for the host to append it and then commit the token.
Replayed(ReplayedTransition<Record, Step>)
This input maps onto a record that already exists. No new record is produced and
step_seq points at the existing one.
Two triggers, one shape:
- input-level replay — the same
input_idwith the same canonical payload; - effect-level dedup (DEC-1) — a new
input_idresolving an already-completed effect with the same payload; the cancellation dedup branch behaves identically.
The second trigger is the one that used to be reported as Prepared while returning the
old step_seq. A host then built a transaction whose step_seq did not increase, its CAS
successor check rejected it as an integrity error, and the run died — a live dead end on
the only durable host.
Rejected(RejectedTransition)
Nothing was accepted, nothing was staged, no state moved.
Implementations§
Source§impl<Record, Step> KernelPreparation<Record, Step>
impl<Record, Step> KernelPreparation<Record, Step>
pub fn record(&self) -> Option<&Record>
Sourcepub fn token(&self) -> Option<&PrepareToken>
pub fn token(&self) -> Option<&PrepareToken>
Only a Prepared transition has something to commit.
pub fn step(&self) -> Option<&Step>
Sourcepub fn step_seq(&self) -> Option<WireU64>
pub fn step_seq(&self) -> Option<WireU64>
The sequence of the record this preparation refers to. Prepared does not have one yet —
its record is not in the journal until the host appends it.
pub fn fault(&self) -> Option<&KernelFault>
Sourcepub fn is_zero_mutation(&self) -> bool
pub fn is_zero_mutation(&self) -> bool
Whether this preparation left the operation byte-identical. True for exactly the rejected arm — the type-level statement of the zero-mutation rule.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the host may re-submit the same input_id unchanged.
Trait Implementations§
Source§impl<Record, Step> Clone for KernelPreparation<Record, Step>
impl<Record, Step> Clone for KernelPreparation<Record, Step>
Source§fn clone(&self) -> KernelPreparation<Record, Step>
fn clone(&self) -> KernelPreparation<Record, Step>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more