pub trait EventCallback {
// Required methods
fn call(&self, event: &Event);
fn as_js_value(&self) -> Option<&JsValue>;
}Expand description
A callback that runs when an event is triggered.
For instance, this might represent the closure in onmyevent = |_| {}.
Required Methods§
Sourcefn as_js_value(&self) -> Option<&JsValue>
fn as_js_value(&self) -> Option<&JsValue>
Get the underlying wasm_bindgen::JsValue.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".