Enum virtual_node::event::EventHandler
source · [−]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
sourceimpl Clone for EventHandler
impl Clone for EventHandler
sourcefn clone(&self) -> EventHandler
fn clone(&self) -> EventHandler
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for EventHandler
impl Debug for EventHandler
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more