Struct metrix::instruments::switches::StaircaseTimer [−][src]
pub struct StaircaseTimer { /* fields omitted */ }
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]
impl StaircaseTimer
pub fn new_with_defaults<T: Into<String>>(name: T) -> StaircaseTimer
[src]
pub fn new_with_defaults<T: Into<String>>(name: T) -> StaircaseTimer
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
Gets the name of this Gauge
pub fn set_name<T: Into<String>>(&mut self, name: T)
[src]
pub fn set_name<T: Into<String>>(&mut self, name: T)
Set the name if this Gauge
.
The name is a path segment within a Snapshot
pub fn set_title<T: Into<String>>(&mut self, title: T)
[src]
pub fn set_title<T: Into<String>>(&mut self, title: T)
Sets the title
of this Gauge
.
A title can be part of a descriptive Snapshot
pub fn set_description<T: Into<String>>(&mut self, description: T)
[src]
pub fn set_description<T: Into<String>>(&mut self, description: T)
Sets the description
of this Gauge
.
A description can be part of a descriptive Snapshot
pub fn set_invert(&mut self, invert: bool)
[src]
pub fn set_invert(&mut self, invert: bool)
Set whether the current value should be inverted in a snapshot or not
Default is false
pub fn enable_invert(&mut self)
[src]
pub fn enable_invert(&mut self)
The current value should be inverted in a snapshot
Same as self.set_invert(true);
pub fn invert(&self) -> bool
[src]
pub fn invert(&self) -> bool
return whether invert is on or off
pub fn set_switch_off_after(&mut self, d: Duration)
[src]
pub fn set_switch_off_after(&mut self, d: Duration)
Sets duration after which the internal state switches back to false
Default is 60 seconds
pub fn switch_off_after(&self) -> Duration
[src]
pub fn switch_off_after(&self) -> Duration
Gets duration after which the internal state switches back to false
pub fn state(&self) -> bool
[src]
pub fn state(&self) -> bool
Returns the current state
Trait Implementations
impl Instrument for StaircaseTimer
[src]
impl Instrument for StaircaseTimer
impl PutsSnapshot for StaircaseTimer
[src]
impl PutsSnapshot for StaircaseTimer
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
Puts the current snapshot values into the given Snapshot
thereby following the guidelines of PutsSnapshot
. Read more
impl Updates for StaircaseTimer
[src]
impl Updates for StaircaseTimer
fn update(&mut self, _: &Update)
[src]
fn update(&mut self, _: &Update)
Update the internal state according to the given Update
. Read more
impl Descriptive for StaircaseTimer
[src]
impl Descriptive for StaircaseTimer
Auto Trait Implementations
impl Send for StaircaseTimer
impl Send for StaircaseTimer
impl Sync for StaircaseTimer
impl Sync for StaircaseTimer