[−][src]Enum myopic_core::Square
Type representing a square on a chessboard.
Variants
Implementations
impl Square
[src]
pub fn iter() -> impl Iterator<Item = Square>
[src]
Return an iterator traversing all squares in order.
pub fn from_index(i: usize) -> Square
[src]
Retrieve a square by it's corresponding index.
pub fn from_string(square: &str) -> Result<Square, String>
[src]
Performs linear search to find a square whose name matches the given string (case-insensitive).
pub const fn rank_index(self) -> usize
[src]
Return the index of the rank on which this square resides.
pub const fn file_index(self) -> usize
[src]
Return the index of the file on which this square resides.
pub fn rank(self) -> BitBoard
[src]
Return a bitboard representing the rank on which this square resides.
pub fn file(self) -> BitBoard
[src]
Return a bitboard representing the file on which this square resides.
pub const fn lift(self) -> BitBoard
[src]
'Lifts' this square to a singleton set of squares.
pub fn next(self, dir: Dir) -> Option<Square>
[src]
Finds the next square on a chessboard from this square in a given direction if it exists.
pub fn search(self, dir: Dir) -> BitBoard
[src]
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>
[src]
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>) -> BitBoard
[src]
Find all squares in all directions in a given vector and returns them as a set.
pub fn search_one(self, dirs: &Vec<Dir>) -> BitBoard
[src]
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
[src]
type Output = BitBoard
The resulting type after applying the &
operator.
fn bitand(self, other: BitBoard) -> Self::Output
[src]
impl BitAnd<Square> for BitBoard
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Square) -> Self
[src]
impl BitOr<BitBoard> for Square
[src]
type Output = BitBoard
The resulting type after applying the |
operator.
fn bitor(self, other: BitBoard) -> Self::Output
[src]
impl BitOr<Square> for BitBoard
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Square) -> Self
[src]
impl BitOr<Square> for Square
[src]
type Output = BitBoard
The resulting type after applying the |
operator.
fn bitor(self, other: Square) -> Self::Output
[src]
impl BitOrAssign<Square> for BitBoard
[src]
fn bitor_assign(&mut self, rhs: Square)
[src]
impl BitXor<Square> for BitBoard
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Square) -> Self
[src]
impl BitXorAssign<Square> for BitBoard
[src]
fn bitxor_assign(&mut self, rhs: Square)
[src]
impl Clone for Square
[src]
impl Copy for Square
[src]
impl Debug for Square
[src]
impl Display for Square
[src]
impl Eq for Square
[src]
impl FromIterator<Square> for BitBoard
[src]
A set of squares can be built from an iterator traversing squares.
fn from_iter<I: IntoIterator<Item = Square>>(iter: I) -> Self
[src]
impl Hash for Square
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Not for Square
[src]
type Output = BitBoard
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl Ord for Square
[src]
fn cmp(&self, other: &Square) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Square> for Square
[src]
impl PartialOrd<Square> for Square
[src]
fn partial_cmp(&self, other: &Square) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Reflectable for Square
[src]
impl Shl<usize> for Square
[src]
type Output = Square
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> Self::Output
[src]
impl Shr<usize> for Square
[src]
type Output = Square
The resulting type after applying the >>
operator.
fn shr(self, rhs: usize) -> Self::Output
[src]
impl StructuralEq for Square
[src]
impl StructuralPartialEq for Square
[src]
impl Sub<BitBoard> for Square
[src]
type Output = BitBoard
The resulting type after applying the -
operator.
fn sub(self, other: BitBoard) -> Self::Output
[src]
impl Sub<Square> for BitBoard
[src]
Auto Trait Implementations
impl RefUnwindSafe for Square
impl Send for Square
impl Sync for Square
impl Unpin for Square
impl UnwindSafe for Square
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,