pub trait Records {
// Required methods
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.