Skip to main content

ComponentState

Trait ComponentState 

Source
pub trait ComponentState: Any {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;

    // Provided methods
    fn handle_action(&mut self, _action: &UiAction) -> ComponentActionOutcome { ... }
    fn advance(&mut self, _elapsed_ms: f32) -> bool { ... }
    fn wants_frame(&self) -> bool { ... }
    fn frame_interval_ms(&self) -> u64 { ... }
    fn take_route_invalidation(&mut self) -> bool { ... }
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Provided Methods§

Source

fn handle_action(&mut self, _action: &UiAction) -> ComponentActionOutcome

Source

fn advance(&mut self, _elapsed_ms: f32) -> bool

Source

fn wants_frame(&self) -> bool

Source

fn frame_interval_ms(&self) -> u64

Source

fn take_route_invalidation(&mut self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§