Struct term_table::cell::Cell
[−]
[src]
pub struct Cell<'data> {
pub data: Cow<'data, str>,
pub col_span: usize,
pub alignment: Alignment,
pub pad_content: bool,
}A table cell containing some str data.
A cell may span multiple columns by setting the value of col_span.
pad_content will add a space to either side of the cell's content.AsRef
Fields
data: Cow<'data, str>
col_span: usize
alignment: Alignment
pad_content: bool
Methods
impl<'data> Cell<'data>[src]
pub fn new<T>(data: T, col_span: usize) -> Cell<'data> where
T: Into<Cow<'data, str>>, [src]
T: Into<Cow<'data, str>>,
pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> Cell<'data> where
T: Into<Cow<'data, str>>, [src]
data: T,
col_span: usize,
alignment: Alignment
) -> Cell<'data> where
T: Into<Cow<'data, str>>,
pub fn new_with_alignment_and_padding<T>(
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> Cell<'data> where
T: Into<Cow<'data, str>>, [src]
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> Cell<'data> where
T: Into<Cow<'data, str>>,
pub fn width(&self) -> usize[src]
Calculates the width of the cell.
New line characters are taken into account during the calculation.
pub fn split_width(&self) -> f32[src]
The width of the cell's content divided by its col_span value.
pub fn wrap_to_width(&self, width: usize) -> Vec<String>[src]
Wraps the cell's content to the provided width.
New line characters are taken into account.
Trait Implementations
impl<'data, T> From<&'data T> for Cell<'data> where
T: Display, [src]
T: Display,