pub trait Element: EventHandler {
// Required methods
fn rect(&self) -> Rect;
fn set_rect(&mut self, rect: Rect);
fn render(&self, canvas: &mut Canvas, z: i32);
fn focus_id(&self) -> Option<FocusId>;
}Expand description
Trait implemented by all renderable UI elements.
Designed for object safety so that external crates (e.g., a future
jag-media) can implement it for their own element types.
Required Methods§
Sourcefn set_rect(&mut self, rect: Rect)
fn set_rect(&mut self, rect: Rect)
Update the bounding rectangle (typically called by the layout engine).