pub struct SimEventLog { /* private fields */ }Expand description
Structured event log for a simulation run.
Records every simulated action with monotonic sequence numbers.
Two runs with the same seed should produce identical logs — use
SimEventLog::diff to verify this and pinpoint the first divergence.
Implementations§
Source§impl SimEventLog
impl SimEventLog
Sourcepub fn record(
&mut self,
timestamp_us: u64,
subsystem: Subsystem,
description: String,
payload: Option<Vec<u8>>,
) -> SeqNo
pub fn record( &mut self, timestamp_us: u64, subsystem: Subsystem, description: String, payload: Option<Vec<u8>>, ) -> SeqNo
Record an event. Returns the assigned sequence number.
Sourcepub fn record_simple(
&mut self,
timestamp_us: u64,
subsystem: Subsystem,
description: impl Into<String>,
) -> SeqNo
pub fn record_simple( &mut self, timestamp_us: u64, subsystem: Subsystem, description: impl Into<String>, ) -> SeqNo
Record a simple event (no payload).
Sourcepub fn entries(&self) -> &[SimLogEntry]
pub fn entries(&self) -> &[SimLogEntry]
Get all entries.
Sourcepub fn diff(a: &SimEventLog, b: &SimEventLog) -> Option<LogDivergence>
pub fn diff(a: &SimEventLog, b: &SimEventLog) -> Option<LogDivergence>
Compare two event logs and find the first point of divergence.
Returns None if the logs are identical (same length, same descriptions,
same subsystems, same payloads at every sequence number).
Returns Some(divergence) with details about where they first differ.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimEventLog
impl RefUnwindSafe for SimEventLog
impl Send for SimEventLog
impl Sync for SimEventLog
impl Unpin for SimEventLog
impl UnsafeUnpin for SimEventLog
impl UnwindSafe for SimEventLog
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
Mutably borrows from an owned value. Read more