pub struct EventLog {
pub events: Vec<LogEvent>,
}Expand description
Append-only timestamped event log for a simulation session.
Fields§
§events: Vec<LogEvent>All recorded events.
Implementations§
Source§impl EventLog
impl EventLog
Sourcepub fn info(
&mut self,
sim_time: f64,
category: impl Into<String>,
message: impl Into<String>,
)
pub fn info( &mut self, sim_time: f64, category: impl Into<String>, message: impl Into<String>, )
Convenience helper: log a message at Info level.
Sourcepub fn warn(
&mut self,
sim_time: f64,
category: impl Into<String>,
message: impl Into<String>,
)
pub fn warn( &mut self, sim_time: f64, category: impl Into<String>, message: impl Into<String>, )
Convenience helper: log a message at Warning level.
Sourcepub fn error(
&mut self,
sim_time: f64,
category: impl Into<String>,
message: impl Into<String>,
)
pub fn error( &mut self, sim_time: f64, category: impl Into<String>, message: impl Into<String>, )
Convenience helper: log a message at Error level.
Sourcepub fn filter_level(&self, min_level: EventLevel) -> Vec<&LogEvent>
pub fn filter_level(&self, min_level: EventLevel) -> Vec<&LogEvent>
Return all events whose severity is at least min_level.
Sourcepub fn filter_category<'a>(&'a self, cat: &str) -> Vec<&'a LogEvent>
pub fn filter_category<'a>(&'a self, cat: &str) -> Vec<&'a LogEvent>
Return all events for the given category.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.