Struct nu_term_grid::grid::Grid
source · [−]pub struct Grid { /* private fields */ }
Expand description
Everything needed to format the cells with the grid options.
For more information, see the grid
crate documentation.
Implementations
sourceimpl Grid
impl Grid
sourcepub fn new(options: GridOptions) -> Self
pub fn new(options: GridOptions) -> Self
Creates a new grid view with the given options.
sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves space in the vector for the given number of additional cells
to be added. (See the Vec::reserve
function.)
sourcepub fn fit_into_width(&self, maximum_width: Width) -> Option<Display<'_>>
pub fn fit_into_width(&self, maximum_width: Width) -> Option<Display<'_>>
Returns a displayable grid that’s been packed to fit into the given width in the fewest number of rows.
Returns None
if any of the cells has a width greater than the
maximum width.
sourcepub fn fit_into_columns(&self, num_columns: usize) -> Display<'_>
pub fn fit_into_columns(&self, num_columns: usize) -> Display<'_>
Returns a displayable grid with the given number of columns, and no maximum width.
Trait Implementations
impl Eq for Grid
impl StructuralEq for Grid
impl StructuralPartialEq for Grid
Auto Trait Implementations
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more