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.