pub struct EventCtx<'a, Ext: 'static> {
pub event: &'a mut Event,
pub dom: &'a mut Dom<Ext>,
}Expand description
Context passed to a handler: mutable Event + mutable Dom.
Fields§
§event: &'a mut Event§dom: &'a mut Dom<Ext>Implementations§
Source§impl<Ext: 'static> EventCtx<'_, Ext>
impl<Ext: 'static> EventCtx<'_, Ext>
Sourcepub fn request_redraw(&mut self)
pub fn request_redraw(&mut self)
Ask the rendering host to repaint after this event completes.
Mutations made through ctx.dom are already seen by the host’s
mutation tracker. Use this for the case the tracker can’t see:
a handler that changed state living outside the DOM that the
next paint will read — e.g. a <canvas> whose paint callback
reads external application state. Without this, such a change
produces no repaint until something else dirties the tree.
Sets a flag on the event (Event::redraw_requested) that the
host harvests after dispatch; rdom-core itself does nothing
with it.
Auto Trait Implementations§
impl<'a, Ext> !RefUnwindSafe for EventCtx<'a, Ext>
impl<'a, Ext> !Send for EventCtx<'a, Ext>
impl<'a, Ext> !Sync for EventCtx<'a, Ext>
impl<'a, Ext> !UnwindSafe for EventCtx<'a, Ext>
impl<'a, Ext> Freeze for EventCtx<'a, Ext>
impl<'a, Ext> Unpin for EventCtx<'a, Ext>
impl<'a, Ext> UnsafeUnpin for EventCtx<'a, Ext>where
&'a mut Dom<Ext>: UnsafeUnpin,
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