pub enum EventHandler<Dom: RealDom> {
NoArgs(Rc<RefCell<dyn FnMut()>>),
MouseEvent(Rc<RefCell<dyn FnMut(Dom::MouseEvent)>>),
Custom(Dom::EventCallback),
}Expand description
Event handlers such as the closure in onclick = |mouse_event| {}.
Variants§
NoArgs(Rc<RefCell<dyn FnMut()>>)
A callback that does not contain any arguments.
MouseEvent(Rc<RefCell<dyn FnMut(Dom::MouseEvent)>>)
Handle mouse events such as onclick and oninput
Custom(Dom::EventCallback)
EventHandler’s that we do not have a dedicated type for. This is useful for custom events.
Trait Implementations§
Source§impl<Dom: RealDom> Clone for EventHandler<Dom>
impl<Dom: RealDom> Clone for EventHandler<Dom>
Source§impl<Dom: RealDom> Debug for EventHandler<Dom>
impl<Dom: RealDom> Debug for EventHandler<Dom>
Auto Trait Implementations§
impl<Dom> !RefUnwindSafe for EventHandler<Dom>
impl<Dom> !Send for EventHandler<Dom>
impl<Dom> !Sync for EventHandler<Dom>
impl<Dom> !UnwindSafe for EventHandler<Dom>
impl<Dom> Freeze for EventHandler<Dom>
impl<Dom> Unpin for EventHandler<Dom>
impl<Dom> UnsafeUnpin for EventHandler<Dom>
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