pub enum EventHandler {
NoArgs(Rc<RefCell<dyn FnMut()>>),
MouseEvent(Rc<RefCell<dyn FnMut(MouseEvent)>>),
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()>>)
A callback that does not contain any arguments.
MouseEvent(Rc<RefCell<dyn FnMut(MouseEvent)>>)
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 duplicate 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 for EventHandler
impl PartialEq for EventHandler
Auto Trait Implementations§
impl Freeze for EventHandler
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