TouchEvent

Trait TouchEvent 

Source
pub trait TouchEvent: Sized {
    // Required methods
    fn from_touch_args(args: &TouchArgs, old_event: &Self) -> Option<Self>;
    fn touch<U, F>(&self, f: F) -> Option<U>
       where F: FnMut(&TouchArgs) -> U;

    // Provided method
    fn touch_args(&self) -> Option<TouchArgs> { ... }
}
Expand description

When a touch is started, moved, ended or cancelled.

Required Methods§

Source

fn from_touch_args(args: &TouchArgs, old_event: &Self) -> Option<Self>

Creates a touch event.

Preserves time stamp from original input event, if any.

Source

fn touch<U, F>(&self, f: F) -> Option<U>
where F: FnMut(&TouchArgs) -> U,

Calls closure if this is a touch event.

Provided Methods§

Source

fn touch_args(&self) -> Option<TouchArgs>

Returns touch arguments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§