pub struct UseEventListenerOptions { /* private fields */ }
Expand description
Options for use_event_listener_with_options
.
Implementations§
Source§impl UseEventListenerOptions
impl UseEventListenerOptions
Sourcepub fn capture(self, value: bool) -> Self
pub fn capture(self, value: bool) -> Self
A boolean value indicating that events of this type will be dispatched to
the registered listener
before being dispatched to any EventTarget
beneath it in the DOM tree. If not specified, defaults to false
.
Sourcepub fn once(self, value: bool) -> Self
pub fn once(self, value: bool) -> Self
A boolean value indicating that the listener
should be invoked at most
once after being added. If true
, the listener
would be automatically
removed when invoked. If not specified, defaults to false
.
Sourcepub fn passive<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn passive<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
A boolean value that, if true
, indicates that the function specified by
listener
will never call
preventDefault()
.
If a passive listener does call preventDefault()
, the user agent will do
nothing other than generate a console warning. If not specified,
defaults to false
– except that in browsers other than Safari,
defaults to true
for the
wheel
,
mousewheel
,
touchstart
and
touchmove
events. See Improving scrolling performance with passive listeners
to learn more.
Trait Implementations§
Source§impl Clone for UseEventListenerOptions
impl Clone for UseEventListenerOptions
Source§fn clone(&self) -> UseEventListenerOptions
fn clone(&self) -> UseEventListenerOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for UseEventListenerOptions
impl Default for UseEventListenerOptions
Source§fn default() -> UseEventListenerOptions
fn default() -> UseEventListenerOptions
impl Copy for UseEventListenerOptions
Auto Trait Implementations§
impl Freeze for UseEventListenerOptions
impl RefUnwindSafe for UseEventListenerOptions
impl Send for UseEventListenerOptions
impl Sync for UseEventListenerOptions
impl Unpin for UseEventListenerOptions
impl UnwindSafe for UseEventListenerOptions
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
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>
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>
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