[−]Enum myopic_brain::Square
Type representing a square on a chessboard.
Variants
Implementations
impl Square
pub fn iter() -> impl Iterator<Item = Square>
Return an iterator traversing all squares in order.
pub fn from_index(i: usize) -> Square
Retrieve a square by it's corresponding index.
pub const fn rank_index(self) -> usize
Return the index of the rank on which this square resides.
pub const fn file_index(self) -> usize
Return the index of the file on which this square resides.
pub fn rank(self) -> BitBoard
Return a bitboard representing the rank on which this square resides.
pub fn file(self) -> BitBoard
Return a bitboard representing the file on which this square resides.
pub const fn lift(self) -> BitBoard
'Lifts' this square to a singleton set of squares.
pub fn next(self, dir: Dir) -> Option<Square>
Finds the next square on a chessboard from this square in a given direction if it exists.
pub fn search(self, dir: Dir) -> BitBoard
Find all squares in a given direction from this square and returns them as a set.
pub fn search_vec(self, dir: Dir) -> Vec<Square, Global>
Find all squares in a given direction from this square and returns them as a vector where the squares are ordered in increasing distance from this square.
pub fn search_all(self, dirs: &Vec<Dir, Global>) -> BitBoard
Find all squares in all directions in a given vector and returns them as a set.
pub fn search_one(self, dirs: &Vec<Dir, Global>) -> BitBoard
Find the squares adjacent to this square in all of the given directions and returns them as a set.
Trait Implementations
impl BitAnd<BitBoard> for Square
type Output = BitBoard
The resulting type after applying the &
operator.
pub fn bitand(self, other: BitBoard) -> <Square as BitAnd<BitBoard>>::Output
impl BitAnd<Square> for BitBoard
type Output = BitBoard
The resulting type after applying the &
operator.
pub fn bitand(self, other: Square) -> BitBoard
impl BitOr<BitBoard> for Square
type Output = BitBoard
The resulting type after applying the |
operator.
pub fn bitor(self, other: BitBoard) -> <Square as BitOr<BitBoard>>::Output
impl BitOr<Square> for BitBoard
type Output = BitBoard
The resulting type after applying the |
operator.
pub fn bitor(self, other: Square) -> BitBoard
impl BitOr<Square> for Square
type Output = BitBoard
The resulting type after applying the |
operator.
pub fn bitor(self, other: Square) -> <Square as BitOr<Square>>::Output
impl BitOrAssign<Square> for BitBoard
pub fn bitor_assign(&mut self, rhs: Square)
impl BitXor<Square> for BitBoard
type Output = BitBoard
The resulting type after applying the ^
operator.
pub fn bitxor(self, rhs: Square) -> BitBoard
impl BitXorAssign<Square> for BitBoard
pub fn bitxor_assign(&mut self, rhs: Square)
impl Clone for Square
pub fn clone(&self) -> Square
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Square
impl Debug for Square
impl Display for Square
impl Eq for Square
impl FromIterator<Square> for BitBoard
A set of squares can be built from an iterator traversing squares.
pub fn from_iter<I>(iter: I) -> BitBoard where
I: IntoIterator<Item = Square>,
I: IntoIterator<Item = Square>,
impl FromStr for Square
type Err = Error
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Square, <Square as FromStr>::Err>
impl Hash for Square
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Not for Square
type Output = BitBoard
The resulting type after applying the !
operator.
pub fn not(self) -> <Square as Not>::Output
impl Ord for Square
pub fn cmp(&self, other: &Square) -> Ordering
#[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<Square> for Square
impl PartialOrd<Square> for Square
pub fn partial_cmp(&self, other: &Square) -> Option<Ordering>
#[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 Reflectable for Square
impl Shl<usize> for Square
type Output = Square
The resulting type after applying the <<
operator.
pub fn shl(self, rhs: usize) -> <Square as Shl<usize>>::Output
impl Shr<usize> for Square
type Output = Square
The resulting type after applying the >>
operator.
pub fn shr(self, rhs: usize) -> <Square as Shr<usize>>::Output
impl StructuralEq for Square
impl StructuralPartialEq for Square
impl Sub<BitBoard> for Square
type Output = BitBoard
The resulting type after applying the -
operator.
pub fn sub(self, other: BitBoard) -> <Square as Sub<BitBoard>>::Output
impl Sub<Square> for BitBoard
Auto Trait Implementations
impl RefUnwindSafe for Square
[src]
impl Send for Square
[src]
impl Sync for Square
[src]
impl Unpin for Square
[src]
impl UnwindSafe for Square
[src]
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> From<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>,