Trait ratel_bandit::Counter

source ·
pub trait Counter<T: Num> {
    // Required methods
    fn counter(&self) -> &T;
    fn reset(&mut self);
    fn update(&mut self, n: T);
}
Expand description

A trait for common methods required by all counters.

Required Methods§

source

fn counter(&self) -> &T

Returns the current value of the counter.

source

fn reset(&mut self)

Resets the counter to its initial values.

source

fn update(&mut self, n: T)

Updates the counter with a new value.

Implementors§