pub trait Track {
Show 23 methods
// Required methods
fn unique_id(&self) -> Id;
fn enabled_level(&self, id: Id) -> Level;
fn monitoring_window_size_for(&self, id: Id) -> Option<u64>;
fn add_entity(
&self,
id: Id,
entity_name: &str,
alternative_names: AlternativeNames<'_>,
) -> Level;
fn enter(&self, enter_into: Id, enter_obj: Id);
fn exit(&self, exit_from: Id, exit_obj: Id);
fn value(&self, id: Id, value: f64);
fn create_entity(&self, created_by: Id, id: Id, name: &str);
fn create_monitor(&self, created_by: Id, id: Id, name: &str);
fn create_lane(&self, created_by: Id, id: Id, name: &str);
fn create_group(&self, created_by: Id, id: Id, name: &str);
fn add_to_group(&self, activity: Id, group_id: Id);
fn remove_from_group(&self, activity: Id, group_id: Id);
fn begin_activity(&self, activity: Id, lane: Id, name: &str);
fn end_activity(&self, activity: Id);
fn create_object(
&self,
created_by: Id,
id: Id,
size: usize,
units: &str,
req_type: u8,
details: &str,
);
fn capacity(&self, id: Id, capacity: Capacity);
fn destroy(&self, destroyed_by: Id, destroyed_obj: Id);
fn connect(&self, connect_from: Id, connect_to: Id);
fn log(&self, msg_by: Id, level: Level, msg: Arguments<'_>);
fn time(&self, set_by: Id, time_ns: f64);
fn shutdown(&self);
// Provided method
fn is_entity_enabled(&self, id: Id, level: Level) -> bool { ... }
}Expand description
This is the interface that is supported by all Trackers.
Required Methods§
Sourcefn enabled_level(&self, id: Id) -> Level
fn enabled_level(&self, id: Id) -> Level
Determine the most verbose tracking level enabled for an entity.
Sourcefn monitoring_window_size_for(&self, id: Id) -> Option<u64>
fn monitoring_window_size_for(&self, id: Id) -> Option<u64>
Return the monitoring window size if it is to be enabled. Entity looked up by its ID.
Sourcefn add_entity(
&self,
id: Id,
entity_name: &str,
alternative_names: AlternativeNames<'_>,
) -> Level
fn add_entity( &self, id: Id, entity_name: &str, alternative_names: AlternativeNames<'_>, ) -> Level
Record an entity being created.
Sourcefn create_entity(&self, created_by: Id, id: Id, name: &str)
fn create_entity(&self, created_by: Id, id: Id, name: &str)
Track when an entity with the given ID is created.
Sourcefn create_monitor(&self, created_by: Id, id: Id, name: &str)
fn create_monitor(&self, created_by: Id, id: Id, name: &str)
Track when a monitor with the given ID is created.
Sourcefn create_lane(&self, created_by: Id, id: Id, name: &str)
fn create_lane(&self, created_by: Id, id: Id, name: &str)
Track when a lane with the given ID is created.
Sourcefn create_group(&self, created_by: Id, id: Id, name: &str)
fn create_group(&self, created_by: Id, id: Id, name: &str)
Track when a group with the given ID is created.
Sourcefn add_to_group(&self, activity: Id, group_id: Id)
fn add_to_group(&self, activity: Id, group_id: Id)
Track when an activity becomes a member of a group.
Sourcefn remove_from_group(&self, activity: Id, group_id: Id)
fn remove_from_group(&self, activity: Id, group_id: Id)
Track when an activity is no longer a member of a group.
Sourcefn begin_activity(&self, activity: Id, lane: Id, name: &str)
fn begin_activity(&self, activity: Id, lane: Id, name: &str)
Track the beginning of a named activity on a lane.
Sourcefn end_activity(&self, activity: Id)
fn end_activity(&self, activity: Id)
Track the end of the current activity on a lane.
Sourcefn create_object(
&self,
created_by: Id,
id: Id,
size: usize,
units: &str,
req_type: u8,
details: &str,
)
fn create_object( &self, created_by: Id, id: Id, size: usize, units: &str, req_type: u8, details: &str, )
Track when an object with the given ID is created.
Sourcefn destroy(&self, destroyed_by: Id, destroyed_obj: Id)
fn destroy(&self, destroyed_by: Id, destroyed_obj: Id)
Track when an entity with the given ID is destroyed.
Sourcefn connect(&self, connect_from: Id, connect_to: Id)
fn connect(&self, connect_from: Id, connect_to: Id)
Track when an entity is connected to another entity
Provided Methods§
Sourcefn is_entity_enabled(&self, id: Id, level: Level) -> bool
fn is_entity_enabled(&self, id: Id, level: Level) -> bool
Determine whether tracking is enabled at a given level for an entity.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Track for CapnProtoTracker
Implementation each Track event
There is a function to emit each Cap’n Proto event structure. These
functions call the helper function
write_event, passing in a
function that is used to populate the event body.
impl Track for DevNullTracker
impl Track for MultiTracker
impl Track for PerfettoTracker
impl Track for TestTracker
impl Track for TextTracker
Implementation for each Track event