ButtonEvent

Trait ButtonEvent 

Source
pub trait ButtonEvent: Sized {
    // Required methods
    fn from_button_args(args: ButtonArgs, old_event: &Self) -> Option<Self>;
    fn button<U, F>(&self, f: F) -> Option<U>
       where F: FnMut(ButtonArgs) -> U;

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

Changed button state.

Required Methods§

Source

fn from_button_args(args: ButtonArgs, old_event: &Self) -> Option<Self>

Creates a button event.

Preserves time stamp from original input event, if any.

Source

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

Calls closure if this is a button event.

Provided Methods§

Source

fn button_args(&self) -> Option<ButtonArgs>

Returns button 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§