pub trait GraphicsBackend {
type Output;
type Error;
fn get_output(
&mut self,
context: &Graphics
) -> Result<Self::Output, Self::Error>;
fn draw_circle(
&mut self,
context: &Graphics,
shape: &Circle,
style: &CircleStyle
) -> Result<(), Self::Error>;
fn on_start(
&mut self,
context: &Graphics,
state: &mut StyleResolver
) -> Result<(), Self::Error> { ... }
fn on_finish(
&mut self,
context: &Graphics,
state: &mut StyleResolver
) -> Result<(), Self::Error> { ... }
fn draw(
&mut self,
context: &Graphics,
state: &mut StyleResolver,
drawable: &dyn Drawable
) -> Result<(), Self::Error> { ... }
}