Skip to main content

PaintDispatcher

Trait PaintDispatcher 

Source
pub trait PaintDispatcher {
    // Required method
    fn dispatch(
        &self,
        canvas: &Canvas,
        payload: &(dyn Any + Send + Sync),
        css: &CssStyle,
        layout: &BoxLayout,
        frame: &PaintFrame,
    );
}
Expand description

Hook to delegate component-specific painting. Implemented by the higher-level crate that owns the actual Component enum.

Required Methods§

Source

fn dispatch( &self, canvas: &Canvas, payload: &(dyn Any + Send + Sync), css: &CssStyle, layout: &BoxLayout, frame: &PaintFrame, )

Called for BoxKind::Component(payload). Implementations downcast payload to the concrete component type and paint into canvas. The canvas is already translated to the content-box origin and clipped if overflow: hidden.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§