#[non_exhaustive]pub enum Event<'a> {
Input(&'a InputEvent),
FocusGained,
FocusLost,
PressCancelled,
}Expand description
Something a widget is asked to react to.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Input(&'a InputEvent)
Raw input, already routed to this widget by hit test or focus.
FocusGained
This widget just took keyboard focus.
FocusLost
This widget just lost keyboard focus.
PressCancelled
A press this widget was holding ended without a release.
The tree drops a held press whenever the thing being pressed stops being reachable — a scene pushed over it, the scene it lives in popped, its node removed or disabled — and no pointer event describes that. A widget that only tracks Down and Up would go on believing a finger is still resting on it, which for anything driving a timer from that belief means waking a panel that nobody is touching.
Ordinary widgets need not handle it: the visual pressed state is cleared by the tree either way.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Event<'a>
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnsafeUnpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
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