pub struct GridPlacement {
pub column: Option<usize>,
pub row: Option<usize>,
pub col_span: usize,
pub row_span: usize,
}Expand description
Placement of a grid item, with optional row and column indices.
Fields§
§column: Option<usize>Explicit column index, or None for auto placement.
row: Option<usize>Explicit row index, or None for auto placement.
col_span: usizeNumber of columns the item spans.
row_span: usizeNumber of rows the item spans.
Implementations§
Source§impl GridPlacement
impl GridPlacement
Sourcepub const AUTO: GridPlacement
pub const AUTO: GridPlacement
Placement with no explicit position and single-cell spans.
Sourcepub fn new() -> GridPlacement
pub fn new() -> GridPlacement
Creates an automatic placement.
Sourcepub fn at(self, column: usize, row: usize) -> GridPlacement
pub fn at(self, column: usize, row: usize) -> GridPlacement
Sets both the column and row index.
Sourcepub fn column(self, column: usize) -> GridPlacement
pub fn column(self, column: usize) -> GridPlacement
Sets the column index.
Sourcepub fn row(self, row: usize) -> GridPlacement
pub fn row(self, row: usize) -> GridPlacement
Sets the row index.
Sourcepub fn span(self, col_span: usize, row_span: usize) -> GridPlacement
pub fn span(self, col_span: usize, row_span: usize) -> GridPlacement
Sets both spans, clamped to at least one cell.
Sourcepub fn col_span(self, span: usize) -> GridPlacement
pub fn col_span(self, span: usize) -> GridPlacement
Sets the column span, clamped to at least one cell.
Sourcepub fn row_span(self, span: usize) -> GridPlacement
pub fn row_span(self, span: usize) -> GridPlacement
Sets the row span, clamped to at least one cell.
Trait Implementations§
Source§impl Clone for GridPlacement
impl Clone for GridPlacement
Source§fn clone(&self) -> GridPlacement
fn clone(&self) -> GridPlacement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GridPlacement
Source§impl Debug for GridPlacement
impl Debug for GridPlacement
Source§impl Default for GridPlacement
impl Default for GridPlacement
Source§fn default() -> GridPlacement
fn default() -> GridPlacement
Returns the “default value” for a type. Read more
impl Eq for GridPlacement
Source§impl PartialEq for GridPlacement
impl PartialEq for GridPlacement
impl StructuralPartialEq for GridPlacement
Auto Trait Implementations§
impl Freeze for GridPlacement
impl RefUnwindSafe for GridPlacement
impl Send for GridPlacement
impl Sync for GridPlacement
impl Unpin for GridPlacement
impl UnsafeUnpin for GridPlacement
impl UnwindSafe for GridPlacement
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