ragnarok::name

Trait NameOfEvent

Source
pub trait NameOfEvent:
    Clone
    + PartialEq
    + Eq
    + Hash
    + Copy
    + Debug
    + Eq
    + Ord {
    // Required methods
    fn is_moved(&self) -> bool;
    fn is_enter(&self) -> bool;
    fn is_pressed(&self) -> bool;
    fn is_released(&self) -> bool;
    fn is_global(&self) -> bool;
    fn does_bubble(&self) -> bool;
    fn does_go_through_solid(&self) -> bool;
    fn new_leave() -> Self;
    fn get_derived_events(&self) -> Vec<Self>;

    // Provided methods
    fn get_global_events(&self) -> Vec<Self> { ... }
    fn get_cancellable_events(&self) -> Vec<Self> { ... }
}

Required Methods§

Source

fn is_moved(&self) -> bool

Check if this event means that the pointer device as moved while hovering a node.

Source

fn is_enter(&self) -> bool

Check if this event means that the pointer device started hovering a node.

Source

fn is_pressed(&self) -> bool

Check if this event means that the pointer device was pressed while hovering a node.

Source

fn is_released(&self) -> bool

Check if this event means that the pointer device was released while hovering and hovering a node.

Source

fn is_global(&self) -> bool

Check if this event is global, where global means that an event will be emitted to every node independently of where they are or how they are.

Source

fn does_bubble(&self) -> bool

Check if this event bubbles, where bubbling means that an ancestor of the event node will be called with the same event unless the event node stops the bubbling.

Source

fn does_go_through_solid(&self) -> bool

Check if this event can go through solid surfaces, e.g keyboard events.

Source

fn new_leave() -> Self

Create a new event that means the pointer device left a hovering node.

Source

fn get_derived_events(&self) -> Vec<Self>

Get a set of events derived from this event. For example, mouse movement derives into mouse movement + mouse enter.

Provided Methods§

Source

fn get_global_events(&self) -> Vec<Self>

Get a set of global events derived from this event.

Source

fn get_cancellable_events(&self) -> Vec<Self>

Get a set of events that will be discarded once this event is cancelled.

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§