pub enum InputSample {
Pointer(PointerSample),
Scroll(ScrollSample),
Gesture(GestureEvent),
}Expand description
One translated input sample, ready to enter a widget tree.
A single OS packet can produce zero, one or several of these — a winit
CursorMoved that the X11 phantom-motion filter drops produces none, a
PointerBackend::cancel_all with three fingers down produces three.
Variants§
Pointer(PointerSample)
Route through
WidgetTree::dispatch_pointer.
Scroll(ScrollSample)
Route through
WidgetTree::dispatch_scroll.
Gesture(GestureEvent)
An already-recognised gesture handed over by the OS — a trackpad pinch, rotation or smart-magnification double tap. Teksilo does not re-recognise these: the OS driver has better data (raw touch on the trackpad surface) than the framework ever will.
Implementations§
Source§impl InputSample
impl InputSample
Sourcepub fn as_pointer(&self) -> Option<&PointerSample>
pub fn as_pointer(&self) -> Option<&PointerSample>
The pointer sample, if this is one. Convenience for the conformance harness and for a caller that only cares about one arm.
Sourcepub fn as_scroll(&self) -> Option<&ScrollSample>
pub fn as_scroll(&self) -> Option<&ScrollSample>
The scroll sample, if this is one.
Sourcepub fn as_gesture(&self) -> Option<&GestureEvent>
pub fn as_gesture(&self) -> Option<&GestureEvent>
The gesture, if this is one.
Trait Implementations§
Source§impl Clone for InputSample
impl Clone for InputSample
Source§fn clone(&self) -> InputSample
fn clone(&self) -> InputSample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for InputSample
impl RefUnwindSafe for InputSample
impl Send for InputSample
impl Sync for InputSample
impl Unpin for InputSample
impl UnsafeUnpin for InputSample
impl UnwindSafe for InputSample
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.