Struct reason_othello::Location [−][src]
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Ord for Location
[src]
fn cmp(&self, other: &Location) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Location> for Location
[src]
impl PartialOrd<Location> for Location
[src]
fn partial_cmp(&self, other: &Location) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Location
[src]
impl StructuralPartialEq for Location
[src]
Auto Trait Implementations
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
[src]
U: FromCast<T>,
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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,