Struct StableFor
pub struct StableFor {
duration: Duration,
current: Option<(DateTime<Utc>, Value)>,
}Expand description
Mutable step that only outputs a value once it has remained the same for a given duration.
The duration is measured using the input timestamps. Values are dropped until the same value has been seen for at least the configured duration. After that, every repetition of the value is output. A different value restarts the timer.
A timestamp that is earlier than the start of the current value is treated as if no time had passed.
input A A B B B B A
time 0s 1s 2s 3s 4s 5s 6s
output - A - - B B - (duration = 1s)Fields§
§duration: Duration§current: Option<(DateTime<Utc>, Value)>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StableFor
impl RefUnwindSafe for StableFor
impl Send for StableFor
impl Sync for StableFor
impl Unpin for StableFor
impl UnwindSafe for StableFor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more