Struct chess_move_gen::Square
[−]
[src]
pub struct Square(pub usize);
Represents a square on the chessboard
Methods
impl Square
[src]
pub fn new(s: usize) -> Square
[src]
pub const fn to_u8(&self) -> u8
[src]
pub fn to_i32(&self) -> i32
[src]
pub fn to_u32(&self) -> u32
[src]
pub fn raw(&self) -> usize
[src]
pub fn diagonal(&self) -> usize
[src]
pub fn anti_diagonal(&self) -> usize
[src]
pub fn inc(&mut self)
[src]
pub fn to_usize(&self) -> usize
[src]
pub fn from_side(&self, side: Side) -> Square
[src]
pub fn flip(&self) -> Square
[src]
pub fn rotate_right(&self, amount: usize) -> Square
[src]
pub fn rotate_left(&self, amount: usize) -> Square
[src]
pub fn to_str(&self) -> &'static str
[src]
pub fn to_string(&self) -> String
[src]
pub fn along_row_with_col(&self, other: Square) -> Square
[src]
pub fn change_row(&self, row: usize) -> Square
[src]
pub fn row(&self) -> usize
[src]
pub fn rowx8(&self) -> usize
[src]
pub fn col(&self) -> usize
[src]
pub fn from(row: usize, col: usize) -> Square
[src]
pub fn parse(s: &str) -> Result<Option<Square>, String>
[src]
Trait Implementations
impl PartialEq for Square
[src]
fn eq(&self, __arg_0: &Square) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Square) -> bool
[src]
This method tests for !=
.
impl PartialOrd for Square
[src]
fn partial_cmp(&self, __arg_0: &Square) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Square) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Square) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Square) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Square) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Copy for Square
[src]
impl Clone for Square
[src]
fn clone(&self) -> Square
[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 Display for Square
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more