pub struct TimeDebouncers;Expand description
Factory for trailing, leading, and trailing-value debouncers.
Implementations§
Source§impl TimeDebouncers
impl TimeDebouncers
Sourcepub fn trailing<F>(delay: Duration, action: F) -> Arc<TrailingDebouncer> ⓘ
pub fn trailing<F>(delay: Duration, action: F) -> Arc<TrailingDebouncer> ⓘ
Builds a debouncer that runs action once after delay elapses without another trigger.
Panics via the debouncer constructor when delay is zero.
Sourcepub fn leading<F>(window: Duration, action: F) -> Arc<LeadingDebouncer> ⓘ
pub fn leading<F>(window: Duration, action: F) -> Arc<LeadingDebouncer> ⓘ
Builds a debouncer that runs action immediately when outside window,
otherwise ignores the trigger. Panics via the constructor when window is zero.
Sourcepub fn trailing_value<T, F>(
delay: Duration,
action: F,
) -> Arc<TrailingValueDebouncer<T>> ⓘ
pub fn trailing_value<T, F>( delay: Duration, action: F, ) -> Arc<TrailingValueDebouncer<T>> ⓘ
Builds a debouncer that runs action with the latest value after delay
elapses without another trigger. Panics via the constructor when delay is zero.
Auto Trait Implementations§
impl Freeze for TimeDebouncers
impl RefUnwindSafe for TimeDebouncers
impl Send for TimeDebouncers
impl Sync for TimeDebouncers
impl Unpin for TimeDebouncers
impl UnsafeUnpin for TimeDebouncers
impl UnwindSafe for TimeDebouncers
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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