Struct flo_canvas::Canvas[][src]

pub struct Canvas { /* fields omitted */ }

A canvas is an abstract interface for drawing graphics. It doesn't actually provide a means to render anything, but rather a way to describe how things should be drawn and pass those on to a renderer elsewhere.

Implementations

impl Canvas[src]

pub fn new() -> Canvas[src]

Creates a new, blank, canvas

pub fn write(&self, to_draw: Vec<Draw>)[src]

Sends some new drawing commands to this canvas

pub fn draw<FnAction>(&self, action: FnAction) where
    FnAction: Send + FnOnce(&mut CanvasGraphicsContext<'_>), 
[src]

Provides a way to draw on this canvas via a GC

pub fn stream(&self) -> impl Stream<Item = Draw> + Send[src]

Creates a stream for reading the instructions from this canvas

pub fn get_drawing(&self) -> Vec<Draw>[src]

Retrieves the list of drawing actions in this canvas

Trait Implementations

impl Drop for Canvas[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.