Struct nls_term_grid::Grid
source · pub struct Grid<'cells, 'seperator> { /* private fields */ }Expand description
The main struct used to format GridCells in a grid like format similar to ls
Implementations§
source§impl<'cells, 'seperator> Grid<'cells, 'seperator>
impl<'cells, 'seperator> Grid<'cells, 'seperator>
sourcepub fn new<S>(
seperator: S,
direction: Direction,
cells: &'cells [GridCell]
) -> Self
pub fn new<S>( seperator: S, direction: Direction, cells: &'cells [GridCell] ) -> Self
Create a new Grid
sourcepub fn fit_into_columns(&self, num_columns: usize) -> Display<'_>
pub fn fit_into_columns(&self, num_columns: usize) -> Display<'_>
Returns a displayable containing the specified number of columns
sourcepub fn fit_into_width(&self, display_width: usize) -> Option<Display<'_>>
pub fn fit_into_width(&self, display_width: usize) -> Option<Display<'_>>
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> Freeze for Grid<'cells, 'seperator>
impl<'cells, 'seperator> RefUnwindSafe for Grid<'cells, 'seperator>
impl<'cells, 'seperator> Send for Grid<'cells, 'seperator>
impl<'cells, 'seperator> Sync for Grid<'cells, 'seperator>
impl<'cells, 'seperator> Unpin for Grid<'cells, 'seperator>
impl<'cells, 'seperator> UnwindSafe for Grid<'cells, 'seperator>
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