Struct telemetry::keyed::KeyedFlag [] [src]

pub struct KeyedFlag<T> {
    // some fields omitted
}

Flag histograms.

Each entry has only two states. Until the first call to record(), it is unset. Once record() has been called once, it is set and won't change anymore. This type is useful if you need to track whether a feature was ever used during a session.

With SerializationFormat::SimpleJson, these histograms are serialized as an array of the keys with which it was called. Keys are sorted by alphabetical order, and appear only once.

Methods

impl<K> KeyedFlag<K> where K: ToString

fn new(service: &Service, name: String) -> KeyedFlag<K>

Trait Implementations

impl<K> KeyedHistogram<K, ()> for KeyedFlag<K> where K: ToString

fn record_cb<F>(&self, cb: F) where F: FnOnce() -> Option<(K, ())>

fn record(&self, key: K, value: T)

impl<T> Clone for KeyedFlag<T>

fn clone(&self) -> Self

fn clone_from(&mut self, source: &Self)