pub trait Cell: AsRef<str> {
// Required methods
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;
// Provided methods
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.
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.