pub enum WatchPredicate {
Changed,
ChangedTo(Value),
ChangedFrom(Value),
CrossedAbove(f64),
CrossedBelow(f64),
BecameTrue,
BecameFalse,
Custom(PredicateFn),
}Expand description
Condition under which a watcher fires, evaluated against (old, new) values.
Variants§
Changed
Fires whenever the watched key’s value changed (any diff entry).
ChangedTo(Value)
Fires when the new value equals the given value.
ChangedFrom(Value)
Fires when the old value equals the given value.
CrossedAbove(f64)
Fires when old < threshold AND new >= threshold (both must be numeric).
CrossedBelow(f64)
Fires when old >= threshold AND new < threshold (both must be numeric).
BecameTrue
Fires when old != true AND new == true (JSON bool).
BecameFalse
Fires when old == true AND new != true (JSON bool).
Custom(PredicateFn)
Fires when the custom function returns true for (old, new).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WatchPredicate
impl !RefUnwindSafe for WatchPredicate
impl Send for WatchPredicate
impl Sync for WatchPredicate
impl Unpin for WatchPredicate
impl !UnwindSafe for WatchPredicate
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