Trait ascii_canvas::AsciiView [−][src]
pub trait AsciiView { fn columns(&self) -> usize; fn read_char(&mut self, row: usize, column: usize) -> char; fn write_char(&mut self, row: usize, column: usize, ch: char, style: Style); }
Expand description
AsciiView is a view onto an AsciiCanvas
which potentially
applies transformations along the way (e.g., shifting, adding
styling information). Most of the main drawing methods for
AsciiCanvas
are defined as inherent methods on an AsciiView
trait object.
Required methods
fn columns(&self) -> usize
[src]
fn read_char(&mut self, row: usize, column: usize) -> char
[src]
fn write_char(&mut self, row: usize, column: usize, ch: char, style: Style)
[src]
Implementations
impl<'a> dyn AsciiView + 'a
[src]
impl<'a> dyn AsciiView + 'a
[src]pub fn draw_vertical_line(&mut self, rows: Range<usize>, column: usize)
[src]
pub fn draw_vertical_line(&mut self, rows: Range<usize>, column: usize)
[src]Draws a line for the given range of rows at the given column.
pub fn draw_horizontal_line(&mut self, row: usize, columns: Range<usize>)
[src]
pub fn draw_horizontal_line(&mut self, row: usize, columns: Range<usize>)
[src]Draws a horizontal line along a given row for the given range of columns.
pub fn write_chars<I>(
&mut self,
row: usize,
column: usize,
chars: I,
style: Style
) where
I: Iterator<Item = char>,
[src]
pub fn write_chars<I>(
&mut self,
row: usize,
column: usize,
chars: I,
style: Style
) where
I: Iterator<Item = char>,
[src]Writes characters in the given style at the given position.
pub fn shift<'c>(&'c mut self, row: usize, column: usize) -> ShiftedView<'c>
[src]
pub fn shift<'c>(&'c mut self, row: usize, column: usize) -> ShiftedView<'c>
[src]Creates a new view onto the same canvas, but writing at an offset.
Implementors
impl AsciiView for AsciiCanvas
[src]
impl AsciiView for AsciiCanvas
[src]impl<'canvas> AsciiView for ShiftedView<'canvas>
[src]
impl<'canvas> AsciiView for ShiftedView<'canvas>
[src]