pub trait WebEventExt {
type WebEvent;
// Required method
fn try_as_web_event(&self) -> Option<Self::WebEvent>;
// Provided method
fn as_web_event(&self) -> Self::WebEvent
where Self::WebEvent: 'static { ... }
}
Expand description
A extension trait for web-sys events that provides a way to get the event as a web-sys event.
Required Associated Types§
Required Methods§
Sourcefn try_as_web_event(&self) -> Option<Self::WebEvent>
fn try_as_web_event(&self) -> Option<Self::WebEvent>
Try to downcast this event as a web-sys
event.
Provided Methods§
Sourcefn as_web_event(&self) -> Self::WebEventwhere
Self::WebEvent: 'static,
fn as_web_event(&self) -> Self::WebEventwhere
Self::WebEvent: 'static,
Downcast this event as a web-sys
event.