pub struct Cell { /* private fields */ }
Expand description
A table cell represents a single grid rectangle within a table.
Cells belong to a row.
Implementations§
Source§impl Cell
impl Cell
pub fn empty() -> Cell
pub fn new(contents: Vec<Content>, base_style: ContentStyle) -> Cell
Sourcepub fn from_styled_content(format: &str, contents: Vec<&str>) -> Cell
pub fn from_styled_content(format: &str, contents: Vec<&str>) -> Cell
Returns a Cell
from styled content.
§Arguments
format
- The style format.contents
- The contents of the new cell.
Sourcepub fn from_data_item(data_item: &DataItem, base_style: ContentStyle) -> Cell
pub fn from_data_item(data_item: &DataItem, base_style: ContentStyle) -> Cell
Returns a Cell
from a DataItem
.
§Arguments
data_item
- The data item from which to build the table cell.base_style
- The base style to apply to the cell contents.
Sourcepub fn get_cell_width(self: &Cell) -> CellWidth
pub fn get_cell_width(self: &Cell) -> CellWidth
Returns the column break specified in the first content line of the cell.
This is used to determine the column break for cells used in the table header row.
Sourcepub fn get_iterator(
self: &Cell,
column_break: &CellWidth,
) -> TableCellContentIterator<'_> ⓘ
pub fn get_iterator( self: &Cell, column_break: &CellWidth, ) -> TableCellContentIterator<'_> ⓘ
Returns the next formatted line of content from this table cell.
§Arguments
self
- The table cell containing the line.width
- The format width.
Sourcepub fn measure_height(self: &Cell, column_break: &CellWidth) -> usize
pub fn measure_height(self: &Cell, column_break: &CellWidth) -> usize
Measures the height needed for this cell when formatting its contents into a specific column width.
§Arguments
self
- The table cell being measured.column_width
- The column width to measure against.
Sourcepub fn measure_width(self: &Cell, column_break: &CellWidth) -> usize
pub fn measure_width(self: &Cell, column_break: &CellWidth) -> usize
Measures the width of this cell.
§Arguments
self
- The table cell being measured.column_break
- The column break for this cell.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cell
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more