Skip to main content

Leaf

Trait Leaf 

Source
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§

Source

fn paint(&self, ctx: &mut PaintCtx<'_>)

Provided Methods§

Source

fn layout_style(&self) -> LayoutStyle

Source

fn intrinsic_size(&self, _ctx: &mut LayoutCtx<'_>) -> Option<Size>

Source

fn on_event(&self, _event: &Event, _ctx: &mut EventCtx<'_>)

Source

fn focusable(&self) -> bool

Source

fn has_visual_state(&self) -> bool

Source

fn cursor(&self, _state: VisualState) -> CursorIcon

Source

fn track(&self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§