pub struct DataDisplay { /* private fields */ }
Expand description
A DataDisplay
simply displays the value of an observation
The DataDisplay
has the capability to reset its value
after a given time. This can be useful if manually resetting the
value after a finished “task” is not desired or possible.
By default the value does not reset. The reset_value
can
be set to a specific value. By default it is None
.
Implementations§
Source§impl DataDisplay
impl DataDisplay
pub fn new<T: Into<String>>(name: T) -> DataDisplay
pub fn new_with_defaults<T: Into<String>>(name: T) -> DataDisplay
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
Sourcepub fn set_reset_after(&mut self, d: Duration)
pub fn set_reset_after(&mut self, d: Duration)
Sets duration after which the internal state switches back to reset value
Default is 60 seconds
Sourcepub fn reset_after(self, d: Duration) -> Self
pub fn reset_after(self, d: Duration) -> Self
Sets duration after which the internal state switches back to reset value
Default is 60 seconds
Sourcepub fn get_reset_after(&self) -> Option<Duration>
pub fn get_reset_after(&self) -> Option<Duration>
Gets duration after which the internal state switches back to reset value
Sourcepub fn set_reset_value<T: Into<ItemKind>>(&mut self, v: T)
pub fn set_reset_value<T: Into<ItemKind>>(&mut self, v: T)
Sets reset value
to be displayed after a reset and as an initial
value
Default is None
Sourcepub fn reset_value<T: Into<ItemKind>>(self, v: T) -> Self
pub fn reset_value<T: Into<ItemKind>>(self, v: T) -> Self
Sets reset value
to be displayed after a reset and as an initial
value
Default is None
Sourcepub fn get_reset_value(&self) -> Option<&ItemKind>
pub fn get_reset_value(&self) -> Option<&ItemKind>
gets reset value
to be displayed after a reset
Default is None
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 DataDisplay
impl Descriptive for DataDisplay
Source§impl PutsSnapshot for DataDisplay
impl PutsSnapshot for DataDisplay
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
.