Struct tui::widgets::canvas::Context[][src]

pub struct Context<'a> { /* fields omitted */ }

Holds the state of the Canvas when painting to it.

Implementations

impl<'a> Context<'a>[src]

pub fn new(
    width: u16,
    height: u16,
    x_bounds: [f64; 2],
    y_bounds: [f64; 2],
    marker: Marker
) -> Context<'a>
[src]

pub fn draw<S>(&mut self, shape: &S) where
    S: Shape
[src]

Draw any object that may implement the Shape trait

pub fn layer(&mut self)[src]

Go one layer above in the canvas.

pub fn print(&mut self, x: f64, y: f64, text: &'a str, color: Color)[src]

Print a string on the canvas at the given position

Trait Implementations

impl<'a> Debug for Context<'a>[src]

impl<'a, 'b> From<&'a mut Context<'b>> for Painter<'a, 'b>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Context<'a>

impl<'a> !Send for Context<'a>

impl<'a> !Sync for Context<'a>

impl<'a> Unpin for Context<'a>

impl<'a> !UnwindSafe for Context<'a>

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.