Trait slog_extlog::stats::StatTrigger [−][src]
pub trait StatTrigger {
fn stat_list(&self) -> &'static [&'static (StatDefinition + Sync)];
fn tag_value(
&self,
stat_id: &StatDefinition,
_tag_name: &'static str
) -> String;
fn condition(&self, _stat_id: &StatDefinition) -> bool { ... }
fn change(&self, _stat_id: &StatDefinition) -> Option<ChangeType> { ... }
fn bucket_value(&self, _stat_id: &StatDefinition) -> Option<f64> { ... }
}A trait indicating that this statistic can be used to trigger a statistics change.
Required Methods
fn stat_list(&self) -> &'static [&'static (StatDefinition + Sync)]
The list of stats that this trigger applies to.
fn tag_value(&self, stat_id: &StatDefinition, _tag_name: &'static str) -> String
Get the associated tag value for this log. The value must be convertable to a string so it can be stored internally.
Provided Methods
fn condition(&self, _stat_id: &StatDefinition) -> bool
The condition that must be satisfied for this stat to change
fn change(&self, _stat_id: &StatDefinition) -> Option<ChangeType>
The details of the change to make for this stat, if condition returned true.
fn bucket_value(&self, _stat_id: &StatDefinition) -> Option<f64>
The value to be used to sort the statistic into the correct bucket(s).