Trait ratatui::widgets::canvas::Shape

source ·
pub trait Shape {
    // Required method
    fn draw(&self, painter: &mut Painter<'_, '_>);
}
Expand description

Something that can be drawn on a Canvas.

You may implement your own canvas custom widgets by implementing this trait.

Required Methods§

source

fn draw(&self, painter: &mut Painter<'_, '_>)

Draws this Shape using the given Painter.

This is the only method required to implement a custom widget that can be drawn on a Canvas.

Implementors§