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