[][src]Struct metrix::instruments::switches::Flag

pub struct Flag { /* fields omitted */ }

A Flag which can have the states true or false

The Flag reacts on observations with values. A value of 0 sets the Flag to false, '1' will set the Flag to true. For all other values the behaviour is undefined.

Methods

impl Flag[src]

pub fn new<T: Into<String>>(name: T) -> Self[src]

pub fn new_with_state<T: Into<String>>(name: T, initial_state: bool) -> Self[src]

pub fn get_name(&self) -> &str[src]

pub fn set_name<T: Into<String>>(&mut self, name: T)[src]

pub fn name<T: Into<String>>(self, name: T) -> Self[src]

pub fn set_title<T: Into<String>>(&mut self, title: T)[src]

pub fn title<T: Into<String>>(self, title: T) -> Self[src]

pub fn set_description<T: Into<String>>(&mut self, description: T)[src]

pub fn description<T: Into<String>>(self, description: T) -> Self[src]

pub fn state(self, initial_state: bool) -> Self[src]

pub fn set_show_inverted(&mut self, name_alternation: NameAlternation)[src]

Show the inverted value. Name will be adjusted with name_alternation.

pub fn show_inverted(self, name_alternation: NameAlternation) -> Self[src]

Show the inverted value. Name will be adjusted with name_alternation.

pub fn set_show_inverted_prefixed<T: Into<String>>(&mut self, prefix: T)[src]

Show the inverted value. Name will be prefixed with prefix.

pub fn show_inverted_prefixed<T: Into<String>>(self, prefix: T) -> Self[src]

Show the inverted value. Name will be prefixed with prefix.

pub fn set_show_inverted_postfixed<T: Into<String>>(&mut self, postfix: T)[src]

Show the inverted value. Name will be postfixed with postfix.

pub fn show_inverted_postfixed<T: Into<String>>(self, postfix: T) -> Self[src]

Show the inverted value. Name will be postfixed with postfix.

pub fn set_show_inverted_renamed<T: Into<String>>(&mut self, new_name: T)[src]

Show the inverted value. Name will be renamed with new_name.

pub fn show_inverted_renamed<T: Into<String>>(self, new_name: T) -> Self[src]

Show the inverted value. Name will be renamed with new_name.

pub fn accept<L: Eq + Send + 'static, F: Into<LabelFilter<L>>>(
    self,
    accept: F
) -> InstrumentAdapter<L, Self>
[src]

pub fn for_label<L: Eq + Send + 'static>(
    self,
    label: L
) -> InstrumentAdapter<L, Self>
[src]

Creates an InstrumentAdapter that makes this instrument react on observations on the given label.

pub fn for_labels<L: Eq + Send + 'static>(
    self,
    labels: Vec<L>
) -> InstrumentAdapter<L, Self>
[src]

Creates an InstrumentAdapter that makes this instrument react on observations with the given labels.

If labels is empty the instrument will not react to any observations

pub fn for_all_labels<L: Eq + Send + 'static>(
    self
) -> InstrumentAdapter<L, Self>
[src]

Creates an InstrumentAdapter that makes this instrument react on all observations.

pub fn for_labels_by_predicate<L, P>(
    self,
    label_predicate: P
) -> InstrumentAdapter<L, Self> where
    L: Eq + Send + 'static,
    P: Fn(&L) -> bool + Send + 'static, 
[src]

Creates an InstrumentAdapter that makes this instrument react on observations with labels specified by the predicate.

pub fn adapter<L: Eq + Send + 'static>(self) -> InstrumentAdapter<L, Self>[src]

Creates an InstrumentAdapter that makes this instrument to no observations.

pub fn get_state(&self) -> Option<bool>[src]

Returns the current state

Trait Implementations

impl Descriptive for Flag[src]

impl Instrument for Flag[src]

impl PutsSnapshot for Flag[src]

impl Updates for Flag[src]

Auto Trait Implementations

impl RefUnwindSafe for Flag

impl Send for Flag

impl Sync for Flag

impl Unpin for Flag

impl UnwindSafe for Flag

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,