pub struct SustainedDetector { /* private fields */ }Expand description
Fires when a state-based condition remains true for at least duration.
On each check():
- If the condition is true and
became_true_atisNone, recordnow. - If the condition is true and
became_true_atisSome(t), returntruewhennow - t >= duration. - If the condition is false, reset
became_true_attoNone.
This detector needs periodic timer checks because it depends on elapsed wall-clock time.
Implementations§
Trait Implementations§
Source§impl PatternDetector for SustainedDetector
impl PatternDetector for SustainedDetector
Auto Trait Implementations§
impl !Freeze for SustainedDetector
impl !RefUnwindSafe for SustainedDetector
impl Send for SustainedDetector
impl Sync for SustainedDetector
impl Unpin for SustainedDetector
impl !UnwindSafe for SustainedDetector
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