pub struct UseIdleOptions { /* private fields */ }
Expand description
Options for use_idle_with_options
.
Implementations§
Source§impl UseIdleOptions
impl UseIdleOptions
Sourcepub fn events(self, value: Vec<String>) -> Self
pub fn events(self, value: Vec<String>) -> Self
Event names to listen to for detected user activity.
Default: vec!["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"]
.
Sourcepub fn listen_for_visibility_change(self, value: bool) -> Self
pub fn listen_for_visibility_change(self, value: bool) -> Self
Whether to listen for document visibility change.
Defaults to true
.
Sourcepub fn initial_state(self, value: bool) -> Self
pub fn initial_state(self, value: bool) -> Self
Initial state of the returned idle
.
Defaults to false
.
Sourcepub fn filter(self, value: FilterOptions) -> Self
pub fn filter(self, value: FilterOptions) -> Self
Allows to debounce or throttle the event listener that is called for
every event (from events
). Defaults to a throttle by 50ms.
Source§impl UseIdleOptions
impl UseIdleOptions
Sourcepub fn debounce(self, ms: impl Into<MaybeSignal<f64>>) -> Self
pub fn debounce(self, ms: impl Into<MaybeSignal<f64>>) -> Self
Debounce
the event listener
by ms
milliseconds.
Sourcepub fn debounce_with_options(
self,
ms: impl Into<MaybeSignal<f64>>,
options: DebounceOptions,
) -> Self
pub fn debounce_with_options( self, ms: impl Into<MaybeSignal<f64>>, options: DebounceOptions, ) -> Self
Debounce
the event listener
by ms
milliseconds with additional options.
Sourcepub fn throttle(self, ms: impl Into<MaybeSignal<f64>>) -> Self
pub fn throttle(self, ms: impl Into<MaybeSignal<f64>>) -> Self
Throttle
the event listener
by ms
milliseconds.
Sourcepub fn throttle_with_options(
self,
ms: impl Into<MaybeSignal<f64>>,
options: ThrottleOptions,
) -> Self
pub fn throttle_with_options( self, ms: impl Into<MaybeSignal<f64>>, options: ThrottleOptions, ) -> Self
Throttle
the event listener
by ms
milliseconds with additional options.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UseIdleOptions
impl !RefUnwindSafe for UseIdleOptions
impl !Send for UseIdleOptions
impl !Sync for UseIdleOptions
impl Unpin for UseIdleOptions
impl !UnwindSafe for UseIdleOptions
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> 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