pub trait Cell: AsRef<str> {
fn get_line(&self, i: usize) -> &str;
fn count_lines(&self) -> usize;
fn width<W>(&self, width_ctrl: W) -> usize
where
W: WidthFunc;
fn line_width<W>(&self, i: usize, width_ctrl: W) -> usize
where
W: WidthFunc;
fn fmt_prefix(&self, _: &mut Formatter<'_>) -> Result { ... }
fn fmt_suffix(&self, _: &mut Formatter<'_>) -> Result { ... }
}
Expand description
Cell imlementation which can be used with VecRecords
.
Required Methods
sourcefn count_lines(&self) -> usize
fn count_lines(&self) -> usize
Returns a number of lines cell has.
sourcefn line_width<W>(&self, i: usize, width_ctrl: W) -> usizewhere
W: WidthFunc,
fn line_width<W>(&self, i: usize, width_ctrl: W) -> usizewhere
W: WidthFunc,
Returns a width of cell line.
Provided Methods
sourcefn fmt_prefix(&self, _: &mut Formatter<'_>) -> Result
fn fmt_prefix(&self, _: &mut Formatter<'_>) -> Result
Prints a prefix.
It might be usefull when used for ANSI prefix.
sourcefn fmt_suffix(&self, _: &mut Formatter<'_>) -> Result
fn fmt_suffix(&self, _: &mut Formatter<'_>) -> Result
Prints a suffix.
It might be usefull when used for ANSI suffix.