pub struct Debouncer { /* private fields */ }
Expand description
A simple debouncer that tracks when an action should be triggered after a period of inactivity
Implementations§
Source§impl Debouncer
impl Debouncer
Sourcepub fn new(delay_ms: u64) -> Self
pub fn new(delay_ms: u64) -> Self
Create a new debouncer with the specified delay in milliseconds
Sourcepub fn should_execute(&mut self) -> bool
pub fn should_execute(&mut self) -> bool
Check if enough time has passed to execute the debounced action Returns true if the action should be executed
Sourcepub fn time_remaining(&self) -> Option<Duration>
pub fn time_remaining(&self) -> Option<Duration>
Get the time remaining before the action will trigger Returns None if no action is pending
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if there’s a pending action
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Debouncer
impl RefUnwindSafe for Debouncer
impl Send for Debouncer
impl Sync for Debouncer
impl Unpin for Debouncer
impl UnwindSafe for Debouncer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more