pub struct BoolGrid {
pub width: usize,
pub height: usize,
pub values: Vec<u64>,
}Expand description
Compact bitwise implementation of a [ValGrid] of bool’s.
Fields§
§width: usize§height: usize§values: Vec<u64>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BoolGrid
impl<'de> Deserialize<'de> for BoolGrid
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
Source§impl ValueGrid<bool> for BoolGrid
impl ValueGrid<bool> for BoolGrid
fn new(width: usize, height: usize, default_value: bool) -> Self
fn get(&self, x: i32, y: i32) -> bool
fn set(&mut self, x: i32, y: i32, value: bool)
fn width(&self) -> usize
fn height(&self) -> usize
fn get_point(&self, point: Point) -> T
fn get_ix(&self, ix: usize) -> T
fn get_ix_point(&self, point: &Point) -> usize
Source§fn compute_ix(&self, x: i32, y: i32) -> usize
fn compute_ix(&self, x: i32, y: i32) -> usize
Gets the index corresponding to a coordinate, which is row-wise.
fn set_point(&mut self, point: Point, value: T)
fn set_ix(&mut self, ix: usize, value: T)
Source§fn point_in_bounds(&self, point: Point) -> bool
fn point_in_bounds(&self, point: Point) -> bool
Tests whether a point is in bounds.
Auto Trait Implementations§
impl Freeze for BoolGrid
impl RefUnwindSafe for BoolGrid
impl Send for BoolGrid
impl Sync for BoolGrid
impl Unpin for BoolGrid
impl UnwindSafe for BoolGrid
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