pub struct CompactedSimulation { /* private fields */ }Expand description
A live simulation whose sealed evidence prefixes are owned by the caller.
This opt-in runtime preserves current authoritative state, deterministic commitments, idempotency, and continuation behavior while retaining only the evidence appended since the most recent seal. Every returned segment is part of the permanent replay record and must be stored contiguously by the caller.
Implementations§
Source§impl CompactedSimulation
impl CompactedSimulation
Sourcepub fn evidence_cursor(&self) -> Result<EvidenceCursor, CanwuError>
pub fn evidence_cursor(&self) -> Result<EvidenceCursor, CanwuError>
Returns the monotonic cut through sealed and retained evidence.
Sourcepub fn checkpoint(&self) -> Result<SimulationCheckpoint, CanwuError>
pub fn checkpoint(&self) -> Result<SimulationCheckpoint, CanwuError>
Captures current state and the total journal cut without cloning sealed evidence.
Sourcepub fn seal_evidence(
&mut self,
) -> Result<Option<EvidenceJournalSegment>, CanwuError>
pub fn seal_evidence( &mut self, ) -> Result<Option<EvidenceJournalSegment>, CanwuError>
Seals and releases the current retained evidence tail.
The runtime changes only after the segment is fully constructed and its
continuation indexes are prepared. An empty retained tail returns
None. The caller owns persistence and must keep all non-empty segments
in exact cursor order for save restoration or replay.
pub const fn time(&self) -> SimTime
pub const fn revision(&self) -> u64
pub fn checkpoint_hash(&self) -> &str
pub fn boundary_head_hash(&self) -> Option<&str>
pub fn world(&self) -> WorldSnapshot
pub fn knowledge(&self) -> &KnowledgeSnapshot
pub fn domain_record( &self, reference: &DomainRecordRef, ) -> Option<&DomainRecord>
pub fn typed_domain_record<T: DomainRecordType>( &self, reference: &TypedDomainRecordRef<T>, ) -> Option<&DomainRecord>
pub fn submit( &mut self, envelope: CommandEnvelope, ) -> Result<CommandReceipt, CanwuError>
pub fn process_command( &mut self, request: CommandRequest, ) -> Result<CommandOutcome, CanwuError>
pub fn enqueue_command( &mut self, due_at: SimTime, priority: i32, request: CommandRequest, ) -> Result<IngressReceipt, CanwuError>
pub fn enqueue_plugin_ingress( &mut self, request: PluginIngressRequest, ) -> Result<IngressReceipt, CanwuError>
pub fn schedule_calendar_boundary( &mut self, due_at: SimTime, cadences: Vec<SystemCadence>, ) -> Result<IngressReceipt, CanwuError>
pub fn advance( &mut self, duration: SimDuration, ) -> Result<Vec<SimEvent>, CanwuError>
pub fn advance_canonical( &mut self, duration: SimDuration, ) -> Result<Vec<BoundaryReceipt>, CanwuError>
pub fn step_canonical(&mut self) -> Result<Option<BoundaryReceipt>, CanwuError>
pub fn settle_boundary( &mut self, request: BoundaryRequest, ) -> Result<BoundaryReceipt, CanwuError>
Sourcepub fn snapshot_with_segments(
&self,
segments: Vec<EvidenceJournalSegment>,
) -> Result<SimulationSnapshot, CanwuError>
pub fn snapshot_with_segments( &self, segments: Vec<EvidenceJournalSegment>, ) -> Result<SimulationSnapshot, CanwuError>
Reconstructs a validated full snapshot from the supplied sealed prefix plus the currently retained tail.
Sourcepub fn replay_journal_with_segments(
&self,
segments: Vec<EvidenceJournalSegment>,
) -> Result<ReplayJournal, CanwuError>
pub fn replay_journal_with_segments( &self, segments: Vec<EvidenceJournalSegment>, ) -> Result<ReplayJournal, CanwuError>
Produces the ordinary exact-replay journal after validating the supplied archive.
Sourcepub fn from_checkpoint_and_journal(
checkpoint: SimulationCheckpoint,
segments: Vec<EvidenceJournalSegment>,
) -> Result<Self, CanwuError>
pub fn from_checkpoint_and_journal( checkpoint: SimulationCheckpoint, segments: Vec<EvidenceJournalSegment>, ) -> Result<Self, CanwuError>
Restores and validates a checkpoint plus its archive, then enters the compact interface with that evidence retained until the caller seals it.
Sourcepub fn from_checkpoint_and_journal_with_plugins(
checkpoint: SimulationCheckpoint,
segments: Vec<EvidenceJournalSegment>,
plugins: &[&dyn SimulationPlugin],
) -> Result<Self, CanwuError>
pub fn from_checkpoint_and_journal_with_plugins( checkpoint: SimulationCheckpoint, segments: Vec<EvidenceJournalSegment>, plugins: &[&dyn SimulationPlugin], ) -> Result<Self, CanwuError>
Restores a compact runtime and rehydrates its exact executable plugins.