Struct tabled::tables::CompactTable
source · pub struct CompactTable<I, D> { /* private fields */ }
Expand description
A table which consumes an IntoRecords
iterator.
It assumes that the content has only single line.
Implementations§
source§impl<I> CompactTable<I, ConstDimension<0, 0>>
impl<I> CompactTable<I, ConstDimension<0, 0>>
sourcepub const fn new(iter: I) -> Selfwhere
I: IntoRecords,
pub const fn new(iter: I) -> Selfwhere
I: IntoRecords,
Creates a new CompactTable
structure with a width dimension for all columns.
source§impl<I, const ROWS: usize, const COLS: usize> CompactTable<I, ConstDimension<COLS, ROWS>>
impl<I, const ROWS: usize, const COLS: usize> CompactTable<I, ConstDimension<COLS, ROWS>>
sourcepub fn height<S: Into<ConstSize<COUNT_ROWS>>, const COUNT_ROWS: usize>(
self,
size: S
) -> CompactTable<I, ConstDimension<COLS, COUNT_ROWS>>
pub fn height<S: Into<ConstSize<COUNT_ROWS>>, const COUNT_ROWS: usize>( self, size: S ) -> CompactTable<I, ConstDimension<COLS, COUNT_ROWS>>
Set a height for each row.
sourcepub fn width<S: Into<ConstSize<COUNT_COLUMNS>>, const COUNT_COLUMNS: usize>(
self,
size: S
) -> CompactTable<I, ConstDimension<COUNT_COLUMNS, ROWS>>
pub fn width<S: Into<ConstSize<COUNT_COLUMNS>>, const COUNT_COLUMNS: usize>( self, size: S ) -> CompactTable<I, ConstDimension<COUNT_COLUMNS, ROWS>>
Set a width for each column.
source§impl<I, D> CompactTable<I, D>
impl<I, D> CompactTable<I, D>
sourcepub fn with_dimension(iter: I, dimension: D) -> Selfwhere
I: IntoRecords,
pub fn with_dimension(iter: I, dimension: D) -> Selfwhere
I: IntoRecords,
Creates a new CompactTable
structure with a known dimension.
Notice that the function wont call Estimate
.
sourcepub fn with<O>(self, option: O) -> Self
pub fn with<O>(self, option: O) -> Self
With is a generic function which applies options to the CompactTable
.
sourcepub fn get_config(&self) -> &CompactConfig
pub fn get_config(&self) -> &CompactConfig
Returns a table config.
sourcepub fn get_config_mut(&mut self) -> &mut CompactConfig
pub fn get_config_mut(&mut self) -> &mut CompactConfig
Returns a table config.
sourcepub fn fmt<W>(self, writer: W) -> Result
pub fn fmt<W>(self, writer: W) -> Result
Format table into fmt::Writeer.
sourcepub fn build<W>(self, writer: W) -> Result<()>
Available on crate feature std
only.
pub fn build<W>(self, writer: W) -> Result<()>
std
only.Format table into a writer.
sourcepub fn to_string(self) -> String
Available on crate feature std
only.
pub fn to_string(self) -> String
std
only.Build a string.
We can’t implement std::string::ToString
cause it does takes &self
reference.
Trait Implementations§
source§impl<I: Clone, D: Clone> Clone for CompactTable<I, D>
impl<I: Clone, D: Clone> Clone for CompactTable<I, D>
source§fn clone(&self) -> CompactTable<I, D>
fn clone(&self) -> CompactTable<I, D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<I, D> RefUnwindSafe for CompactTable<I, D>where
D: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, D> Send for CompactTable<I, D>
impl<I, D> Sync for CompactTable<I, D>
impl<I, D> Unpin for CompactTable<I, D>
impl<I, D> UnwindSafe for CompactTable<I, D>where
D: UnwindSafe,
I: UnwindSafe,
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