Struct DataDisplay

Source
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

Source

pub fn new<T: Into<String>>(name: T) -> DataDisplay

Source

pub fn new_with_defaults<T: Into<String>>(name: T) -> DataDisplay

Source

pub fn get_name(&self) -> &str

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn reset_after(self, d: Duration) -> Self

Sets duration after which the internal state switches back to reset value

Default is 60 seconds

Source

pub fn get_reset_after(&self) -> Option<Duration>

Gets duration after which the internal state switches back to reset value

Source

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

Source

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

Source

pub fn get_reset_value(&self) -> Option<&ItemKind>

gets reset value to be displayed after a reset

Default is None

Source

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

Source

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.

Source

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

Source

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

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

Source

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,

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

Source

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

Creates an InstrumentAdapter that makes this instrument to no observations.

Source

pub fn value(&self) -> Option<ItemKind>

Returns the current state

Trait Implementations§

Source§

impl Descriptive for DataDisplay

Source§

fn title(&self) -> Option<&str>

Source§

fn description(&self) -> Option<&str>

Source§

impl PutsSnapshot for DataDisplay

Source§

fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)

Puts the current snapshot values into the given Snapshot thereby following the guidelines of PutsSnapshot.
Source§

impl Updates for DataDisplay

Source§

fn update(&mut self, update: &Update) -> usize

Update the internal state according to the given Update. Read more
Source§

impl Instrument for DataDisplay

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V