Trait Drawable

Source
pub trait Drawable<DB: DrawingBackend> {
    // Required method
    fn draw<I: Iterator<Item = BackendCoord>>(
        &self,
        pos: I,
        backend: &mut DB,
    ) -> Result<(), DrawingErrorKind<DB::ErrorType>>;
}
Expand description

The trait indicates we are able to draw it on a drawing area

Required Methods§

Source

fn draw<I: Iterator<Item = BackendCoord>>( &self, pos: I, backend: &mut DB, ) -> Result<(), DrawingErrorKind<DB::ErrorType>>

Actually draws the element. The key points is already translated into the image cooridnate and can be used by DC directly

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, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Circle<'a, Coord>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Cross<'a, Coord>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Path<'a, Coord>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Pixel<'a, Coord>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Rectangle<'a, Coord>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend, T: Borrow<str>> Drawable<DB> for MultiLineText<'a, Coord, T>

Source§

impl<'a, Coord: 'a, DB: DrawingBackend, T: Borrow<str>> Drawable<DB> for Text<'a, Coord, T>

Source§

impl<'a, X: 'a, Y: 'a + PartialOrd, DB: DrawingBackend> Drawable<DB> for CandleStick<'a, X, Y>

Source§

impl<Coord, DB: DrawingBackend> Drawable<DB> for EmptyElement<Coord, DB>

Source§

impl<Coord, DB: DrawingBackend, A, B> Drawable<DB> for ComposedElement<Coord, DB, A, B>
where for<'a> &'a A: PointCollection<'a, BackendCoord>, for<'b> &'b B: PointCollection<'b, BackendCoord>, A: Drawable<DB>, B: Drawable<DB>,

Source§

impl<DB: DrawingBackend, Coord: Clone> Drawable<DB> for DynElement<DB, Coord>