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]
impl<'data> Cell<'data>pub fn new<T>(data: T, col_span: usize) -> Cell<'data> where
T: ToString, [src]
pub fn new<T>(data: T, col_span: usize) -> Cell<'data> where
T: ToString, pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> Cell<'data> where
T: ToString, [src]
pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> Cell<'data> where
T: ToString, pub fn new_with_alignment_and_padding<T>(
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> Cell<'data> where
T: ToString, [src]
pub fn new_with_alignment_and_padding<T>(
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> Cell<'data> where
T: ToString, pub fn width(&self) -> usize[src]
pub fn width(&self) -> usizeCalculates the width of the cell.
New line characters are taken into account during the calculation.
pub fn split_width(&self) -> f32[src]
pub fn split_width(&self) -> f32The width of the cell's content divided by its col_span value.
pub fn min_width(&self) -> usize[src]
pub fn min_width(&self) -> usizeThe minium width required to display the cell properly
pub fn wrap_to_width(&self, width: usize) -> Vec<String>[src]
pub fn wrap_to_width(&self, width: usize) -> Vec<String>Wraps the cell's content to the provided width.
New line characters are taken into account.