Enum chess::File [−][src]
pub enum File { A, B, C, D, E, F, G, H, }
Describe a file (column) on a chess board
Variants
A
B
C
D
E
F
G
H
Methods
impl File
[src]
impl File
pub fn from_index(i: usize) -> File
[src]
pub fn from_index(i: usize) -> File
Convert a usize
into a File
(the inverse of to_index). If i > 7, wrap around.
pub fn left(&self) -> File
[src]
pub fn left(&self) -> File
Go one file to the left. If impossible, wrap around.
pub fn right(&self) -> File
[src]
pub fn right(&self) -> File
Go one file to the right. If impossible, wrap around.
pub fn to_index(&self) -> usize
[src]
pub fn to_index(&self) -> usize
Convert this File
into a usize
from 0 to 7 inclusive.
Trait Implementations
impl Copy for File
[src]
impl Copy for File
impl Clone for File
[src]
impl Clone for File
fn clone(&self) -> File
[src]
fn clone(&self) -> File
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for File
[src]
impl PartialEq for File
fn eq(&self, other: &File) -> bool
[src]
fn eq(&self, other: &File) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialOrd for File
[src]
impl PartialOrd for File
fn partial_cmp(&self, other: &File) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &File) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more