Struct reason_othello::Location[][src]

pub struct Location(_);

A location on the Othello board.

Implementations

impl Location[src]

pub fn from_onehot(bitboard: Bitboard) -> Self[src]

Convert from a one-hot Bitboard.

pub fn from_onehot_unchecked(bitboard: Bitboard) -> Self[src]

Convert from a one-hot Bitboard without checking this invariant. Results in inconsistent state if bitboard has more than one location set.

pub fn from_index(index: u8) -> Self[src]

Convert from a row-major square index.

pub fn to_index(self) -> u8[src]

Convert into a row-major square index.

pub fn from_coords(row: usize, col: usize) -> Self[src]

Convert from row and column coordinates.

pub fn to_coords(self) -> (usize, usize)[src]

Get the row and column coordinates.

Trait Implementations

impl Clone for Location[src]

impl Copy for Location[src]

impl Debug for Location[src]

impl Display for Location[src]

Convert this Location into string notation (“A4”).

impl Eq for Location[src]

impl From<Location> for Move[src]

impl From<Location> for Bitboard[src]

impl FromStr for Location[src]

Build a Location from a 1-indexed string notation (“A4”; “PASS”). Returns None if the string is not valid notation.

type Err = ParseLocationError

The associated error which can be returned from parsing.

impl Ord for Location[src]

impl PartialEq<Location> for Location[src]

impl PartialOrd<Location> for Location[src]

impl StructuralEq for Location[src]

impl StructuralPartialEq for Location[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.