Trait Canvas

Source
pub trait Canvas {
    // Required methods
    fn set_pen(&mut self, color: Color);
    fn print_text(&mut self, p: &Point, text: &str);
    fn draw_line(&mut self, points: &[Point]);
    fn draw_polygon(&mut self, points: &[Point]);
    fn fill_polygon(&mut self, points: &[Point]);
}
Expand description

A generic canvas trait. Implement this trait to become a drawing canvas.

Required Methods§

Source

fn set_pen(&mut self, color: Color)

Source

fn print_text(&mut self, p: &Point, text: &str)

Source

fn draw_line(&mut self, points: &[Point])

Source

fn draw_polygon(&mut self, points: &[Point])

Source

fn fill_polygon(&mut self, points: &[Point])

Implementors§

Source§

impl<'w> Canvas for SvgOutput<'w>

Implement the canvas API for svg output!