pub trait Bitmap {
// Required methods
fn create(&self, area: Area) -> Box<dyn Bitmap + 'static>;
fn set_pixel(
&mut self,
point: Point,
color: Color,
) -> Result<(), PixelabError>;
fn fill(&mut self, color: Color) -> Result<(), PixelabError>;
fn overlay(
&mut self,
fb: &mut Box<dyn Bitmap + 'static>,
point: Point,
) -> Result<(), PixelabError>;
fn buffer(&mut self) -> &mut BitmapFormat;
fn area(&mut self) -> &mut Area;
// Provided methods
fn draw_line(
&mut self,
start_point: Point,
end_point: Point,
color: Color,
) -> Result<(), PixelabError> { ... }
fn set_border(&mut self, color: Color) -> Result<(), PixelabError> { ... }
fn draw_poly_line(
&mut self,
points: Vec<(Point, Color)>,
) -> Result<(), PixelabError> { ... }
}Required Methods§
fn create(&self, area: Area) -> Box<dyn Bitmap + 'static>
fn set_pixel(&mut self, point: Point, color: Color) -> Result<(), PixelabError>
fn fill(&mut self, color: Color) -> Result<(), PixelabError>
fn overlay( &mut self, fb: &mut Box<dyn Bitmap + 'static>, point: Point, ) -> Result<(), PixelabError>
fn buffer(&mut self) -> &mut BitmapFormat
fn area(&mut self) -> &mut Area
Provided Methods§
fn draw_line( &mut self, start_point: Point, end_point: Point, color: Color, ) -> Result<(), PixelabError>
fn set_border(&mut self, color: Color) -> Result<(), PixelabError>
fn draw_poly_line( &mut self, points: Vec<(Point, Color)>, ) -> Result<(), PixelabError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".