pub struct SimTracer { /* private fields */ }Expand description
Thread-safe event recorder for simulation runs.
Create one per simulation, pass references to components that need to record events, then retrieve the full event log after the run.
Implementations§
Source§impl SimTracer
impl SimTracer
pub fn new() -> Self
Sourcepub fn record_now(
&self,
node: usize,
face: Option<u32>,
kind: EventKind,
name: impl Into<String>,
detail: Option<String>,
)
pub fn record_now( &self, node: usize, face: Option<u32>, kind: EventKind, name: impl Into<String>, detail: Option<String>, )
Record an event with automatic timestamping.
Sourcepub fn events_for_node(&self, node: usize) -> Vec<SimEvent>
pub fn events_for_node(&self, node: usize) -> Vec<SimEvent>
Filter events by node.
Sourcepub fn events_of_kind(&self, kind: &EventKind) -> Vec<SimEvent>
pub fn events_of_kind(&self, kind: &EventKind) -> Vec<SimEvent>
Filter events by kind.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SimTracer
impl RefUnwindSafe for SimTracer
impl Send for SimTracer
impl Sync for SimTracer
impl Unpin for SimTracer
impl UnwindSafe for SimTracer
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