pub struct Point(/* private fields */);
Expand description
Specifies a sudoku element’s location in space.
The point is fully specified in DIMENSIONS
dimensions.
§Coordinate System
The coordinate system used in this library sets the origin in the top-left corner, with increasing x to the right and increasing y downward.
Additional axes (if applicable) follow the right-hand rule.
Implementations§
Source§impl Point
impl Point
Sourcepub fn fold(&self, order: u8) -> usize
pub fn fold(&self, order: u8) -> usize
Compresses an n-dimensional point to a single coordinate.
Inverse of Point::unfold
.
Sourcepub fn unfold(value: usize, order: u8) -> Self
pub fn unfold(value: usize, order: u8) -> Self
Decompresses a single coordinate into an n-dimensional point.
Inverse of Point::fold
.
Sourcepub fn snap(self, order: u8) -> Self
pub fn snap(self, order: u8) -> Self
Snaps a point to the grid (returns the upper-left corner of the box).
Sourcepub fn with_x(value: u8) -> Self
pub fn with_x(value: u8) -> Self
Creates a point with the given x-coordinate and all other coordinates zero.
Trait Implementations§
impl Copy for Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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