pub enum EventHandler<Dom>where
Dom: RealDom,{
NoArgs(Rc<RefCell<dyn FnMut()>>),
MouseEvent(Rc<RefCell<dyn FnMut(<Dom as RealDom>::MouseEvent)>>),
Custom(<Dom as RealDom>::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 as RealDom>::MouseEvent)>>)
Handle mouse events such as onclick and oninput
Custom(<Dom as RealDom>::EventCallback)
EventHandler’s that we do not have a dedicated type for. This is useful for custom events.
Trait Implementations§
Source§impl<Dom> Clone for EventHandler<Dom>where
Dom: RealDom,
impl<Dom> Clone for EventHandler<Dom>where
Dom: RealDom,
Source§fn clone(&self) -> EventHandler<Dom>
fn clone(&self) -> EventHandler<Dom>
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<Dom> Debug for EventHandler<Dom>where
Dom: RealDom,
impl<Dom> Debug for EventHandler<Dom>where
Dom: RealDom,
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