pub struct TableGrid { /* private fields */ }Expand description
The derived logical grid of a table (strict; see module docs).
Implementations§
Source§impl TableGrid
impl TableGrid
Sourcepub fn from_table(table: &Table) -> Result<Self, GridError>
pub fn from_table(table: &Table) -> Result<Self, GridError>
Derives the logical grid, failing on any tiling violation.
§Errors
GridError::TooLarge when the grid would exceed
MAX_GRID_POSITIONS; GridError::Overlap /
GridError::OverhangsBottom / GridError::NotTiled when the
cells do not tile the grid rectangle exactly.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Grid dimensions as (rows, cols) in logical positions.
Sourcepub fn resolve(&self, at: GridCoord) -> Option<&GridCell>
pub fn resolve(&self, at: GridCoord) -> Option<&GridCell>
Resolves a logical position to the cell covering it.
Positions inside a merged region resolve to the region’s anchor.
Returns None when the position lies outside the grid.
Sourcepub fn iter_anchors(&self) -> impl Iterator<Item = &GridCell>
pub fn iter_anchors(&self) -> impl Iterator<Item = &GridCell>
Iterates over anchor cells in row-major placement order.
Trait Implementations§
impl Eq for TableGrid
impl StructuralPartialEq for TableGrid
Auto Trait Implementations§
impl Freeze for TableGrid
impl RefUnwindSafe for TableGrid
impl Send for TableGrid
impl Sync for TableGrid
impl Unpin for TableGrid
impl UnsafeUnpin for TableGrid
impl UnwindSafe for TableGrid
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.