ActionTrait

Trait ActionTrait 

Source
pub trait ActionTrait:
    Debug
    + PartialEq
    + Eq
    + Clone
    + Copy
    + Hash
    + Send
    + Sync {
    type State;
    type Event: Event + Send + Sync + 'static;

    // Required method
    fn handle(
        &self,
        state: &mut Self::State,
        event_writer: &mut EventWriter<'_, Self::Event>,
    );
}
Expand description

A type conforming to this trait is used to handle the events that are generated as the user interacts with the menu

Required Associated Types§

Source

type State

Source

type Event: Event + Send + Sync + 'static

Required Methods§

Source

fn handle( &self, state: &mut Self::State, event_writer: &mut EventWriter<'_, Self::Event>, )

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§