[][src]Trait slog_extlog::stats::StatTrigger

pub trait StatTrigger {
    fn stat_list(&self) -> &[StatDefinitionTagged];
fn tag_value(
        &self,
        stat_id: &StatDefinitionTagged,
        _tag_name: &'static str
    ) -> String; fn condition(&self, _stat_id: &StatDefinitionTagged) -> bool { ... }
fn change(&self, _stat_id: &StatDefinitionTagged) -> Option<ChangeType> { ... }
fn bucket_value(&self, _stat_id: &StatDefinitionTagged) -> Option<f64> { ... } }

A trait indicating that this log can be used to trigger a statistics change.

Required methods

fn stat_list(&self) -> &[StatDefinitionTagged]

The list of stats that this trigger applies to.

fn tag_value(
    &self,
    stat_id: &StatDefinitionTagged,
    _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.

Loading content...

Provided methods

fn condition(&self, _stat_id: &StatDefinitionTagged) -> bool

The condition that must be satisfied for this stat to change

fn change(&self, _stat_id: &StatDefinitionTagged) -> Option<ChangeType>

The details of the change to make for this stat, if condition returned true.

fn bucket_value(&self, _stat_id: &StatDefinitionTagged) -> Option<f64>

The value to be used to sort the statistic into the correct bucket(s).

Loading content...

Implementors

Loading content...