pub enum Handled {
No,
Yes,
}Expand description
Whether an event was consumed.
Variants§
No
The widget ignored the event.
Yes
The widget acted on the event.
This also marks the node dirty. A widget that consumes an event has
almost always changed what it draws, and the cost of being wrong is
repainting one widget-sized rectangle. Missing an invalidation costs a
stale frame that only shows up on hardware, so the default errs the cheap
way. Use EventCtx::invalidate for the rare change that consumes nothing.
Implementations§
Source§impl Handled
impl Handled
Sourcepub const fn is_handled(self) -> bool
pub const fn is_handled(self) -> bool
Returns true for Handled::Yes.
Trait Implementations§
impl Copy for Handled
impl Eq for Handled
impl StructuralPartialEq for Handled
Auto Trait Implementations§
impl Freeze for Handled
impl RefUnwindSafe for Handled
impl Send for Handled
impl Sync for Handled
impl Unpin for Handled
impl UnsafeUnpin for Handled
impl UnwindSafe for Handled
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