Trait Canvas

Source
pub trait Canvas {
Show 15 methods // Required methods fn draw_shape(&mut self, shape: &mut impl Shape); fn change_color(&mut self, color: Color); fn clamp_row(&self, row: i64) -> i64; fn clamp_col(&self, col: i64) -> i64; fn set_pixel(&mut self, row: usize, col: usize); fn set_pixel_color(&mut self, row: usize, col: usize, color: Color); fn color_at(&self, index: usize) -> Color; fn width(&self) -> usize; fn height(&self) -> usize; fn fits_inside(&self, row: i64, col: i64) -> bool; fn fill(&mut self); fn antialiasing(&self) -> bool; fn resolution(&self) -> usize; fn color(&self) -> Color; fn buffer_mut_slice(&mut self) -> &mut [Color] ;
}

Required Methods§

Source

fn draw_shape(&mut self, shape: &mut impl Shape)

Source

fn change_color(&mut self, color: Color)

Source

fn clamp_row(&self, row: i64) -> i64

Source

fn clamp_col(&self, col: i64) -> i64

Source

fn set_pixel(&mut self, row: usize, col: usize)

Source

fn set_pixel_color(&mut self, row: usize, col: usize, color: Color)

Source

fn color_at(&self, index: usize) -> Color

Source

fn width(&self) -> usize

Source

fn height(&self) -> usize

Source

fn fits_inside(&self, row: i64, col: i64) -> bool

Source

fn fill(&mut self)

Source

fn antialiasing(&self) -> bool

Source

fn resolution(&self) -> usize

Source

fn color(&self) -> Color

Source

fn buffer_mut_slice(&mut self) -> &mut [Color]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Canvas for SimpleCanvas<'a>