pub struct Grid<'cells, 'seperator, D: Display> { /* private fields */ }Expand description
The main struct used to format GridCells in a grid like format similar to ls
Implementations§
Source§impl<'cells, 'seperator, D: Display> Grid<'cells, 'seperator, D>
impl<'cells, 'seperator, D: Display> Grid<'cells, 'seperator, D>
Sourcepub fn new<S>(
seperator: S,
direction: Direction,
cells: &'cells [GridCell<D>],
) -> Self
pub fn new<S>( seperator: S, direction: Direction, cells: &'cells [GridCell<D>], ) -> Self
Create a new Grid
Sourcepub fn fit_into_columns(&self, num_columns: usize) -> Display<'_, D>
pub fn fit_into_columns(&self, num_columns: usize) -> Display<'_, D>
Returns a displayable containing the specified number of columns
Sourcepub fn fit_into_width(&self, display_width: usize) -> Option<Display<'_, D>>
pub fn fit_into_width(&self, display_width: usize) -> Option<Display<'_, D>>
Returns a well packed displayable grid fitted within display width
Returns None if one of the GridCell contains a width greator than the display width
Trait Implementations§
Auto Trait Implementations§
impl<'cells, 'seperator, D> Freeze for Grid<'cells, 'seperator, D>
impl<'cells, 'seperator, D> RefUnwindSafe for Grid<'cells, 'seperator, D>where
D: RefUnwindSafe,
impl<'cells, 'seperator, D> Send for Grid<'cells, 'seperator, D>where
D: Sync,
impl<'cells, 'seperator, D> Sync for Grid<'cells, 'seperator, D>where
D: Sync,
impl<'cells, 'seperator, D> Unpin for Grid<'cells, 'seperator, D>
impl<'cells, 'seperator, D> UnwindSafe for Grid<'cells, 'seperator, D>where
D: RefUnwindSafe,
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