pub struct TblFit { /* private fields */ }
Expand description
A fitter, accumulating data about the table which must fit into a given width, then computing the best column widths.
Implementations§
source§impl TblFit
impl TblFit
sourcepub fn new(
cols_count: usize,
available_width: usize
) -> Result<Self, InsufficientWidthError>
pub fn new(
cols_count: usize,
available_width: usize
) -> Result<Self, InsufficientWidthError>
Build a new fitter, or return an error if the width isn’t enough for the given number of columns.
available_width: total available width, including external borders
pub fn see_cell(&mut self, col_idx: usize, cell_width: usize)
sourcepub fn fit(&self) -> TblFitResult
pub fn fit(&self) -> TblFitResult
compute the fitting