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>) -> UseIdleOptions
pub fn events(self, value: Vec<String>) -> UseIdleOptions
Event names to listen to on window for detected user activity.
Default: vec!["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"].
Sourcepub fn listen_for_visibility_change(self, value: bool) -> UseIdleOptions
pub fn listen_for_visibility_change(self, value: bool) -> UseIdleOptions
Whether to listen for document visibility change.
Defaults to true.
Sourcepub fn initial_state(self, value: bool) -> UseIdleOptions
pub fn initial_state(self, value: bool) -> UseIdleOptions
Initial state of the returned idle.
Defaults to false.
Sourcepub fn filter(self, value: FilterOptions) -> UseIdleOptions
pub fn filter(self, value: FilterOptions) -> UseIdleOptions
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<Signal<f64>>) -> UseIdleOptions
pub fn debounce(self, ms: impl Into<Signal<f64>>) -> UseIdleOptions
Debounce
the event listener
by ms milliseconds.
Sourcepub fn debounce_with_options(
self,
ms: impl Into<Signal<f64>>,
options: DebounceOptions,
) -> UseIdleOptions
pub fn debounce_with_options( self, ms: impl Into<Signal<f64>>, options: DebounceOptions, ) -> UseIdleOptions
Debounce
the event listener
by ms milliseconds with additional options.
Sourcepub fn throttle(self, ms: impl Into<Signal<f64>>) -> UseIdleOptions
pub fn throttle(self, ms: impl Into<Signal<f64>>) -> UseIdleOptions
Throttle
the event listener
by ms milliseconds.
Sourcepub fn throttle_with_options(
self,
ms: impl Into<Signal<f64>>,
options: ThrottleOptions,
) -> UseIdleOptions
pub fn throttle_with_options( self, ms: impl Into<Signal<f64>>, options: ThrottleOptions, ) -> UseIdleOptions
Throttle
the event listener
by ms milliseconds with additional options.
Trait Implementations§
Source§impl Default for UseIdleOptions
impl Default for UseIdleOptions
Source§fn default() -> UseIdleOptions
fn default() -> UseIdleOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UseIdleOptions
impl RefUnwindSafe for UseIdleOptions
impl Send for UseIdleOptions
impl Sync for UseIdleOptions
impl Unpin for UseIdleOptions
impl UnsafeUnpin 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> 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 moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.