Struct sudoku::Point
[−]
[src]
pub struct Point(_);
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.
Methods
impl Point
[src]
pub fn fold(&self, order: u8) -> usize
[src]
Compresses an n-dimensional point to a single coordinate.
Inverse of Point::unfold
.
pub fn unfold(value: usize, order: u8) -> Self
[src]
Decompresses a single coordinate into an n-dimensional point.
Inverse of Point::fold
.
pub fn snap(self, order: u8) -> Self
[src]
Snaps a point to the grid (returns the upper-left corner of the box).
pub fn with_x(value: u8) -> Self
[src]
Creates a point with the given x-coordinate and all other coordinates zero.
pub fn with_y(value: u8) -> Self
[src]
Creates a point with the given y-coordinate and all other coordinates zero.
pub fn origin() -> Self
[src]
The point with all coordinates identically zero.
Trait Implementations
impl Copy for Point
[src]
impl Clone for Point
[src]
fn clone(&self) -> Point
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Point
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Point
[src]
fn eq(&self, __arg_0: &Point) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Point) -> bool
[src]
This method tests for !=
.
impl Index<usize> for Point
[src]
type Output = u8
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Point
[src]
fn index_mut(&mut self, index: usize) -> &mut u8
[src]
Performs the mutable indexing (container[index]
) operation.
impl Display for Point
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more