Skip to main content

Widget

Trait Widget 

Source
pub trait Widget {
    // Required methods
    fn id(&self) -> u64;
    fn render(&self, ctx: &mut RenderCtx);
    fn handle(&mut self, event: &Event) -> bool;
}
Expand description

Core trait for all UI elements.

Required Methods§

Source

fn id(&self) -> u64

Source

fn render(&self, ctx: &mut RenderCtx)

Source

fn handle(&mut self, event: &Event) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§