pub struct Grid { /* private fields */ }Expand description
A layout widget that arranges children in a grid specified by rows and columns. A layout widget that arranges children in a grid specified by rows and columns.
Each row and column is defined by a Unit, which you can read more about
in its documentation.
Children can be placed by specifying their zero-based column and row indices.
§Example
let mut grid = Grid::new(
vec![Unit::Length(3), Unit::Length(5), Unit::Fill(1)],
vec![Unit::Fill(1), Unit::Length(1), Unit::Fill(1)],
);
grid.push("Grid", 1, 1);
let mut term = Term::default();
term.render(grid)?;Implementations§
Trait Implementations§
Source§impl Widget for Grid
impl Widget for Grid
Source§fn height(&self, size: &Vec2) -> usize
fn height(&self, size: &Vec2) -> usize
Returns the height of the
Widget based on the width of the given
size.Auto Trait Implementations§
impl Freeze for Grid
impl !RefUnwindSafe for Grid
impl !Send for Grid
impl !Sync for Grid
impl Unpin for Grid
impl !UnwindSafe for Grid
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