pub trait Records {
fn count_rows(&self) -> usize;
fn count_columns(&self) -> usize;
fn get_text(&self, pos: Position) -> &str;
fn get_line(&self, pos: Position, i: usize) -> &str;
fn count_lines(&self, pos: Position) -> usize;
fn get_width<W>(&self, pos: Position, width_ctrl: W) -> usize
where
W: WidthFunc;
fn get_line_width<W>(&self, pos: Position, i: usize, width_ctrl: W) -> usize
where
W: WidthFunc;
fn fmt_text_prefix(&self, f: &mut Formatter<'_>, pos: Position) -> Result;
fn fmt_text_suffix(&self, f: &mut Formatter<'_>, pos: Position) -> Result;
}
Expand description
The representaion of data, rows and columns of a Grid
.
Required Methods
sourcefn count_rows(&self) -> usize
fn count_rows(&self) -> usize
Returns amount of rows on a grid.
sourcefn count_columns(&self) -> usize
fn count_columns(&self) -> usize
Returns amount of columns on a grid.
sourcefn get_line(&self, pos: Position, i: usize) -> &str
fn get_line(&self, pos: Position, i: usize) -> &str
Returns a line of a text of a cell by an index.
sourcefn count_lines(&self, pos: Position) -> usize
fn count_lines(&self, pos: Position) -> usize
Returns an amount of lines of a text of a cell by an index.
sourcefn get_width<W>(&self, pos: Position, width_ctrl: W) -> usizewhere
W: WidthFunc,
fn get_width<W>(&self, pos: Position, width_ctrl: W) -> usizewhere
W: WidthFunc,
Returns a width of a text of a cell by an index.
sourcefn get_line_width<W>(&self, pos: Position, i: usize, width_ctrl: W) -> usizewhere
W: WidthFunc,
fn get_line_width<W>(&self, pos: Position, i: usize, width_ctrl: W) -> usizewhere
W: WidthFunc,
Returns a width of line of a text of a cell by an index.
sourcefn fmt_text_prefix(&self, f: &mut Formatter<'_>, pos: Position) -> Result
fn fmt_text_prefix(&self, f: &mut Formatter<'_>, pos: Position) -> Result
Prints a prefix of a text of a cell by an index.
Maybe be usefull in order to emit ANSI sequences.
sourcefn fmt_text_suffix(&self, f: &mut Formatter<'_>, pos: Position) -> Result
fn fmt_text_suffix(&self, f: &mut Formatter<'_>, pos: Position) -> Result
Prints a suffix of a text of a cell by an index.
Maybe be usefull in order to emit ANSI sequences.