pub struct Flag { /* private fields */ }
Expand description
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.
Implementations§
Source§impl Flag
impl Flag
pub fn new<T: Into<String>>(name: T) -> Self
pub fn new_with_state<T: Into<String>>(name: T, initial_state: bool) -> Self
pub fn get_name(&self) -> &str
pub fn set_name<T: Into<String>>(&mut self, name: T)
pub fn name<T: Into<String>>(self, name: T) -> Self
pub fn set_title<T: Into<String>>(&mut self, title: T)
pub fn title<T: Into<String>>(self, title: T) -> Self
pub fn set_description<T: Into<String>>(&mut self, description: T)
pub fn description<T: Into<String>>(self, description: T) -> Self
pub fn state(self, initial_state: bool) -> Self
Sourcepub fn set_show_inverted(&mut self, name_alternation: NameAlternation)
pub fn set_show_inverted(&mut self, name_alternation: NameAlternation)
Show the inverted value. Name will be adjusted with name_alternation
.
Sourcepub fn show_inverted(self, name_alternation: NameAlternation) -> Self
pub fn show_inverted(self, name_alternation: NameAlternation) -> Self
Show the inverted value. Name will be adjusted with name_alternation
.
Sourcepub fn set_show_inverted_prefixed<T: Into<String>>(&mut self, prefix: T)
pub fn set_show_inverted_prefixed<T: Into<String>>(&mut self, prefix: T)
Show the inverted value. Name will be prefixed with prefix
.
Sourcepub fn show_inverted_prefixed<T: Into<String>>(self, prefix: T) -> Self
pub fn show_inverted_prefixed<T: Into<String>>(self, prefix: T) -> Self
Show the inverted value. Name will be prefixed with prefix
.
Sourcepub fn set_show_inverted_postfixed<T: Into<String>>(&mut self, postfix: T)
pub fn set_show_inverted_postfixed<T: Into<String>>(&mut self, postfix: T)
Show the inverted value. Name will be postfixed with postfix
.
Sourcepub fn show_inverted_postfixed<T: Into<String>>(self, postfix: T) -> Self
pub fn show_inverted_postfixed<T: Into<String>>(self, postfix: T) -> Self
Show the inverted value. Name will be postfixed with postfix
.
Sourcepub fn set_show_inverted_renamed<T: Into<String>>(&mut self, new_name: T)
pub fn set_show_inverted_renamed<T: Into<String>>(&mut self, new_name: T)
Show the inverted value. Name will be renamed with new_name
.
Sourcepub fn show_inverted_renamed<T: Into<String>>(self, new_name: T) -> Self
pub fn show_inverted_renamed<T: Into<String>>(self, new_name: T) -> Self
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>
Sourcepub fn for_label<L: Eq + Send + 'static>(
self,
label: L,
) -> InstrumentAdapter<L, Self>
pub fn for_label<L: Eq + Send + 'static>( self, label: L, ) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument
react on observations on the given label.
Sourcepub fn for_labels<L: Eq + Send + 'static>(
self,
labels: Vec<L>,
) -> InstrumentAdapter<L, Self>
pub fn for_labels<L: Eq + Send + 'static>( self, labels: Vec<L>, ) -> InstrumentAdapter<L, Self>
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
Sourcepub fn for_all_labels<L: Eq + Send + 'static>(
self,
) -> InstrumentAdapter<L, Self>
pub fn for_all_labels<L: Eq + Send + 'static>( self, ) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument react on
all observations.
Sourcepub fn for_labels_by_predicate<L, P>(
self,
label_predicate: P,
) -> InstrumentAdapter<L, Self>
pub fn for_labels_by_predicate<L, P>( self, label_predicate: P, ) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument react on
observations with labels specified by the predicate.
Sourcepub fn adapter<L: Eq + Send + 'static>(self) -> InstrumentAdapter<L, Self>
pub fn adapter<L: Eq + Send + 'static>(self) -> InstrumentAdapter<L, Self>
Creates an InstrumentAdapter
that makes this instrument to no
observations.
Trait Implementations§
Source§impl Descriptive for Flag
impl Descriptive for Flag
Source§impl PutsSnapshot for Flag
impl PutsSnapshot for Flag
Source§fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
Snapshot
thereby
following the guidelines of PutsSnapshot
.