pub struct NativeEventHandler { /* private fields */ }Expand description
A wrapper around an event callback.
Stores the event name and a shared reference to the callback closure.
Uses Rc<UnsafeCell<>> instead of Rc<RefCell<>> to avoid runtime
borrow checking overhead in the single-threaded WASM context.
The Rc provides automatic memory management (freed when last reference drops).
Implementations§
Trait Implementations§
Source§impl Clone for NativeEventHandler
impl Clone for NativeEventHandler
Source§fn clone(&self) -> NativeEventHandler
fn clone(&self) -> NativeEventHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NativeEventHandler
impl Debug for NativeEventHandler
Source§impl From<NativeEventHandler> for AttributeValue
Converts an owned event handler into a callback attribute value.
impl From<NativeEventHandler> for AttributeValue
Converts an owned event handler into a callback attribute value.
Re-wraps the handler with a generic “callback” event name so that
subsequent EventAdapter::into_attribute calls can override it with
the correct DOM event type.
Source§fn from(handler: NativeEventHandler) -> Self
fn from(handler: NativeEventHandler) -> Self
Converts this event handler into an AttributeValue::Event.
§Returns
AttributeValue- An event attribute value with a generic callback event name.
Auto Trait Implementations§
impl !RefUnwindSafe for NativeEventHandler
impl !Send for NativeEventHandler
impl !Sync for NativeEventHandler
impl !UnwindSafe for NativeEventHandler
impl Freeze for NativeEventHandler
impl Unpin for NativeEventHandler
impl UnsafeUnpin for NativeEventHandler
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