pub struct Machine { /* private fields */ }Expand description
In-memory reference machine for the Semantic Interpreter and Embedded profiles. All ambient I/O belongs in higher-level runtime crates.
Implementations§
Source§impl Machine
impl Machine
Sourcepub fn snapshot(&self) -> MachineSnapshot
pub fn snapshot(&self) -> MachineSnapshot
Export canonical inputs for durable persistence.
Sourcepub fn restore(snapshot: MachineSnapshot) -> Result<Self>
pub fn restore(snapshot: MachineSnapshot) -> Result<Self>
Restore a Machine and deterministically rebuild all projections.
Sourcepub fn compact_event_history(
&mut self,
retain_suffix: usize,
) -> Result<MachineCompaction>
pub fn compact_event_history( &mut self, retain_suffix: usize, ) -> Result<MachineCompaction>
Compact a causally closed event prefix and retain a full suffix.
Sourcepub fn seal_plan(&mut self, candidate: PlanCandidate) -> Result<SealedPlan>
pub fn seal_plan(&mut self, candidate: PlanCandidate) -> Result<SealedPlan>
Validate, seal, and store a Plan Candidate.
Sourcepub fn insert_plan(&mut self, plan: SealedPlan) -> Result<()>
pub fn insert_plan(&mut self, plan: SealedPlan) -> Result<()>
Insert and verify an already sealed plan.
Sourcepub fn plan(&self, plan_id: &str) -> Option<&SealedPlan>
pub fn plan(&self, plan_id: &str) -> Option<&SealedPlan>
Read a sealed plan.
Sourcepub fn put_artifact(
&mut self,
kind: impl Into<String>,
bytes: Vec<u8>,
) -> ArtifactRef
pub fn put_artifact( &mut self, kind: impl Into<String>, bytes: Vec<u8>, ) -> ArtifactRef
Store immutable typed bytes and return their content reference.
Sourcepub fn artifact(&self, reference: &ArtifactRef) -> Option<&ArtifactRecord>
pub fn artifact(&self, reference: &ArtifactRef) -> Option<&ArtifactRecord>
Read an immutable artifact.
Sourcepub fn remove_artifact_for_test(
&mut self,
artifact_id: &str,
) -> Option<ArtifactRecord>
pub fn remove_artifact_for_test( &mut self, artifact_id: &str, ) -> Option<ArtifactRecord>
Remove an artifact to exercise retention behavior in conformance tests.
Sourcepub fn replay_availability(
&self,
required: &[ArtifactRef],
) -> ReplayAvailability
pub fn replay_availability( &self, required: &[ArtifactRef], ) -> ReplayAvailability
Classify replay capability for a required artifact set.
Sourcepub fn submit(&mut self, envelope: CommandEnvelope) -> Result<CommandReceipt>
pub fn submit(&mut self, envelope: CommandEnvelope) -> Result<CommandReceipt>
Admit an idempotent command and reduce its canonical event.
Sourcepub fn append_event(&mut self, event: Event) -> Result<()>
pub fn append_event(&mut self, event: Event) -> Result<()>
Append a trusted event after identity, parent, and transition validation.
Sourcepub const fn projection(&self) -> &Projection
pub const fn projection(&self) -> &Projection
Current rebuildable projection.
Sourcepub fn replay(events: impl IntoIterator<Item = Event>) -> Result<Projection>
pub fn replay(events: impl IntoIterator<Item = Event>) -> Result<Projection>
Rebuild a projection from an unordered causal event set.
Sourcepub fn verify_replay(&self) -> Result<()>
pub fn verify_replay(&self) -> Result<()>
Replay all current events and verify the digest matches the live projection.