pub struct Grid { /* private fields */ }Expand description
A 2D grid layout container.
Implementations§
Source§impl Grid
impl Grid
Sourcepub fn rows(self, constraints: impl IntoIterator<Item = Constraint>) -> Self
pub fn rows(self, constraints: impl IntoIterator<Item = Constraint>) -> Self
Set the row constraints.
Sourcepub fn columns(self, constraints: impl IntoIterator<Item = Constraint>) -> Self
pub fn columns(self, constraints: impl IntoIterator<Item = Constraint>) -> Self
Set the column constraints.
Sourcepub fn area(self, name: impl Into<String>, area: GridArea) -> Self
pub fn area(self, name: impl Into<String>, area: GridArea) -> Self
Define a named area in the grid.
Named areas allow semantic access to grid regions:
ⓘ
let grid = Grid::new()
.rows([Constraint::Fixed(3), Constraint::Min(10)])
.columns([Constraint::Fixed(20), Constraint::Min(40)])
.area("sidebar", GridArea::span(0, 0, 2, 1)) // Left column, both rows
.area("content", GridArea::cell(0, 1)) // Top right
.area("footer", GridArea::cell(1, 1)); // Bottom rightSourcepub fn split(&self, area: Rect) -> GridLayout
pub fn split(&self, area: Rect) -> GridLayout
Split the given area according to the grid configuration.
Trait Implementations§
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