Struct titik::Buffer[][src]

pub struct Buffer { /* fields omitted */ }

Contains a vec of cells. Buffer contains the information needed to render into the screen

Implementations

impl Buffer[src]

pub fn new(width: usize, height: usize) -> Self[src]

create a buffer with size

pub fn reset(&mut self)[src]

reset the content of the buffer to empty

pub fn set_symbol<S: ToString>(&mut self, x: usize, y: usize, symbol: S)[src]

set the character of this location with symbol

pub fn write_str<S: ToString>(&mut self, x: usize, y: usize, s: S)[src]

enumerate the characters in the string and set the cells horizontally incrementing on the x component

pub fn write_bold_str<S: ToString>(&mut self, x: usize, y: usize, s: S)[src]

write string as bold

pub fn set_cell(&mut self, x: usize, y: usize, new_cell: Cell)[src]

set the cell at this location

pub fn diff<'a>(&self, new: &'a Self) -> Vec<(usize, usize, &'a Cell)>[src]

get the diff of 2 buffers

pub fn render(&self, w: &mut dyn Write) -> Result<()>[src]

writes to the stdout buffer

Trait Implementations

impl Debug for Buffer[src]

impl Display for Buffer[src]

impl PartialEq<Buffer> for Buffer[src]

impl StructuralPartialEq for Buffer[src]

Auto Trait Implementations

impl RefUnwindSafe for Buffer

impl Send for Buffer

impl Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

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> Pointable for T

type Init = T

The type for initializers.

impl<T> ToString for T where
    T: Display + ?Sized
[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.