[−][src]Struct metrix::instruments::switches::StaircaseTimer
A StaircaseTimer is 'tapped' by an Observation
and then stays on for some time.
The StaircaseTimer works exactly like a switch in
a staircase: You press the switch and the light will
stay on for some time. Here it is an Observation that
pushes the switch and the light is a boolean that will
be set to true for some time. When triggered while
already on, the time being true will be prolonged.
The state written to a Snapshot can be inverted.
Methods
impl StaircaseTimer[src]
pub fn new<T: Into<String>>(name: T) -> StaircaseTimer[src]
pub fn new_with_defaults<T: Into<String>>(name: T) -> StaircaseTimer[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 set_invert(&mut self, invert: bool)[src]
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn enable_invert(&mut self)[src]
The current value should be inverted in a snapshot
Same as self.set_invert(true);
pub fn invert(&self) -> bool[src]
return whether invert is on or off
pub fn set_switch_off_after(&mut self, d: Duration)[src]
Sets duration after which the internal state switches back to false
Default is 60 seconds
pub fn switch_off_after(self, d: Duration) -> Self[src]
Sets duration after which the internal state switches back to false
Default is 60 seconds
pub fn get_switch_off_after(&self) -> Duration[src]
Gets duration after which the internal state switches back to false
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 for_label<L: Eq>(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>(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>(self) -> InstrumentAdapter<L, Self>[src]
Creates an InstrumentAdapter that makes this instrument react on
all observations.
pub fn adapter<L: Eq>(self) -> InstrumentAdapter<L, Self>[src]
Creates an InstrumentAdapter that makes this instrument to no
observations.
pub fn state(&self) -> bool[src]
Returns the current state
Trait Implementations
impl Updates for StaircaseTimer[src]
impl Instrument for StaircaseTimer[src]
impl Descriptive for StaircaseTimer[src]
impl PutsSnapshot for StaircaseTimer[src]
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)[src]
Auto Trait Implementations
impl Send for StaircaseTimer
impl Sync for StaircaseTimer
impl Unpin for StaircaseTimer
impl UnwindSafe for StaircaseTimer
impl RefUnwindSafe for StaircaseTimer
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,