pub struct GridBlock {
pub row: u32,
pub col: u32,
pub cells: Vec<Vec<GridCell>>,
}Expand description
Known cells of a grid: row-major cells from (row, col), 0-based.
Fields§
§row: u32§col: u32§cells: Vec<Vec<GridCell>>Implementations§
Source§impl GridBlock
impl GridBlock
Sourcepub fn width(&self) -> u32
pub fn width(&self) -> u32
Columns the block covers (its longest row; a short row’s missing cells are empty).
Sourcepub fn covers(&self, row: u32, col: u32) -> bool
pub fn covers(&self, row: u32, col: u32) -> bool
Whether (row, col) of the sheet is in the block.
Sourcepub fn get(&self, row: u32, col: u32) -> Option<Option<&GridCell>>
pub fn get(&self, row: u32, col: u32) -> Option<Option<&GridCell>>
The cell at (row, col) of the sheet: Some(None) for an empty cell of the block,
None outside it.
Sourcepub fn cell_count(&self) -> usize
pub fn cell_count(&self) -> usize
Cells in the block.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GridBlock
impl<'de> Deserialize<'de> for GridBlock
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 StructuralPartialEq for GridBlock
Auto Trait Implementations§
impl Forget for GridBlock
impl Freeze for GridBlock
impl Move for GridBlock
impl RefUnwindSafe for GridBlock
impl Send for GridBlock
impl Sync for GridBlock
impl Unpin for GridBlock
impl UnsafeUnpin for GridBlock
impl UnwindSafe for GridBlock
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