pub trait Leaf: 'static {
// Required method
fn paint(&self, ctx: &mut PaintCtx<'_>);
// Provided methods
fn layout_style(&self) -> LayoutStyle { ... }
fn intrinsic_size(&self, _ctx: &mut LayoutCtx<'_>) -> Option<Size> { ... }
fn on_event(&self, _event: &Event, _ctx: &mut EventCtx<'_>) { ... }
fn focusable(&self) -> bool { ... }
fn has_visual_state(&self) -> bool { ... }
fn cursor(&self, _state: VisualState) -> CursorIcon { ... }
fn track(&self) { ... }
}Required Methods§
Provided Methods§
fn layout_style(&self) -> LayoutStyle
fn intrinsic_size(&self, _ctx: &mut LayoutCtx<'_>) -> Option<Size>
fn on_event(&self, _event: &Event, _ctx: &mut EventCtx<'_>)
fn focusable(&self) -> bool
fn has_visual_state(&self) -> bool
fn cursor(&self, _state: VisualState) -> CursorIcon
fn track(&self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".