#[repr(u8)]
pub enum SquareCoordinate {
Show 65 variants A8, B8, C8, D8, E8, F8, G8, H8, A7, B7, C7, D7, E7, F7, G7, H7, A6, B6, C6, D6, E6, F6, G6, H6, A5, B5, C5, D5, E5, F5, G5, H5, A4, B4, C4, D4, E4, F4, G4, H4, A3, B3, C3, D3, E3, F3, G3, H3, A2, B2, C2, D2, E2, F2, G2, H2, A1, B1, C1, D1, E1, F1, G1, H1, __BAD_COORD,
}

Variants§

§

A8

§

B8

§

C8

§

D8

§

E8

§

F8

§

G8

§

H8

§

A7

§

B7

§

C7

§

D7

§

E7

§

F7

§

G7

§

H7

§

A6

§

B6

§

C6

§

D6

§

E6

§

F6

§

G6

§

H6

§

A5

§

B5

§

C5

§

D5

§

E5

§

F5

§

G5

§

H5

§

A4

§

B4

§

C4

§

D4

§

E4

§

F4

§

G4

§

H4

§

A3

§

B3

§

C3

§

D3

§

E3

§

F3

§

G3

§

H3

§

A2

§

B2

§

C2

§

D2

§

E2

§

F2

§

G2

§

H2

§

A1

§

B1

§

C1

§

D1

§

E1

§

F1

§

G1

§

H1

§

__BAD_COORD

Implementations§

source§

impl SquareCoordinate

source

pub fn to_index(&self) -> usize

Convert a Square enum to its associated value (A8 = 0, B8 = 1, etc.)

source

pub fn to_san(&self) -> String

Convert square to standard algebraic notation

source

pub fn is_light_sq(&self) -> bool

source

pub fn is_dark_sq(&self) -> bool

source

pub fn rank(&self) -> u8

source

pub fn file(&self) -> u8

source

pub fn above(&self) -> Result<Self, ChessError>

source

pub fn below(&self) -> Result<Self, ChessError>

source

pub fn left(&self) -> Result<Self, ChessError>

source

pub fn right(&self) -> Result<Self, ChessError>

source

pub fn upper_left(&self) -> Result<Self, ChessError>

source

pub fn upper_right(&self) -> Result<Self, ChessError>

source

pub fn lower_left(&self) -> Result<Self, ChessError>

source

pub fn lower_right(&self) -> Result<Self, ChessError>

source

pub fn subtract(&self, rhs: usize) -> Result<Self, ChessError>

Trait Implementations§

source§

impl Clone for SquareCoordinate

source§

fn clone(&self) -> SquareCoordinate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SquareCoordinate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<SquareCoordinate> for SquareCoordinate

source§

fn eq(&self, other: &SquareCoordinate) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for SquareCoordinate

source§

impl Eq for SquareCoordinate

source§

impl StructuralEq for SquareCoordinate

source§

impl StructuralPartialEq for SquareCoordinate

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.