Enum percy_dom::event::EventHandler
source · pub enum EventHandler {
NoArgs(Rc<RefCell<dyn FnMut() + 'static>>),
MouseEvent(Rc<RefCell<dyn FnMut(MouseEvent) + 'static>>),
UnsupportedSignature(EventAttribFn),
}
Expand description
Event handlers such as the closure in onclick = |event| {}
.
Cloning
Can be cheaply cloned since since inner types are reference counted.
Variants§
NoArgs(Rc<RefCell<dyn FnMut() + 'static>>)
A callback that does not contain any arguments.
MouseEvent(Rc<RefCell<dyn FnMut(MouseEvent) + 'static>>)
Handle mouse events such as onclick
and oninput
UnsupportedSignature(EventAttribFn)
EventHandler’s that we do not have a dedicated type for. This is useful for custom events.
Trait Implementations§
source§impl Clone for EventHandler
impl Clone for EventHandler
source§fn clone(&self) -> EventHandler
fn clone(&self) -> EventHandler
Returns a copy of the value. Read more
1.0.0 · 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 EventHandler
impl Debug for EventHandler
source§impl PartialEq<EventHandler> for EventHandler
impl PartialEq<EventHandler> for EventHandler
source§fn eq(&self, _other: &EventHandler) -> bool
fn eq(&self, _other: &EventHandler) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.Auto Trait Implementations§
impl !RefUnwindSafe for EventHandler
impl !Send for EventHandler
impl !Sync for EventHandler
impl Unpin for EventHandler
impl !UnwindSafe for EventHandler
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