pub struct GridArea {
pub row_start: usize,
pub row_end: usize,
pub col_start: usize,
pub col_end: usize,
}Expand description
A named grid area spanning rows and columns.
Fields§
§row_start: usizeStarting row (0-indexed)
row_end: usizeEnding row (exclusive)
col_start: usizeStarting column (0-indexed)
col_end: usizeEnding column (exclusive)
Implementations§
Source§impl GridArea
impl GridArea
Sourcepub const fn new(
row_start: usize,
col_start: usize,
row_end: usize,
col_end: usize,
) -> Self
pub const fn new( row_start: usize, col_start: usize, row_end: usize, col_end: usize, ) -> Self
Create a new grid area.
Sourcepub const fn row_span(row: usize, col_start: usize, col_end: usize) -> Self
pub const fn row_span(row: usize, col_start: usize, col_end: usize) -> Self
Create an area spanning multiple columns in a single row.
Sourcepub const fn col_span(col: usize, row_start: usize, row_end: usize) -> Self
pub const fn col_span(col: usize, row_start: usize, row_end: usize) -> Self
Create an area spanning multiple rows in a single column.
Sourcepub const fn row_span_count(&self) -> usize
pub const fn row_span_count(&self) -> usize
Get the number of rows this area spans.
Sourcepub const fn col_span_count(&self) -> usize
pub const fn col_span_count(&self) -> usize
Get the number of columns this area spans.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GridArea
impl<'de> Deserialize<'de> for GridArea
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for GridArea
impl Eq for GridArea
impl StructuralPartialEq for GridArea
Auto Trait Implementations§
impl Freeze for GridArea
impl RefUnwindSafe for GridArea
impl Send for GridArea
impl Sync for GridArea
impl Unpin for GridArea
impl UnwindSafe for GridArea
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.