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 moreAuto 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