pub struct Square(/* private fields */);Expand description
One square, with a1 as the least-significant bit.
Implementations§
Source§impl Square
impl Square
pub const COUNT: usize = 64
Sourcepub const fn new(index: u8) -> Self
pub const fn new(index: u8) -> Self
Creates a square from its rank-first zero-based index.
§Panics
Panics when index is greater than 63.
pub const fn index(self) -> usize
pub const fn file(self) -> u8
pub const fn rank(self) -> u8
pub const fn mirrored(self) -> Self
pub fn all() -> impl Iterator<Item = Self>
Trait Implementations§
impl Copy for Square
impl Eq for Square
Source§impl Ord for Square
impl Ord for Square
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Square
impl PartialOrd for Square
impl StructuralPartialEq for Square
Auto Trait Implementations§
impl Freeze for Square
impl RefUnwindSafe for Square
impl Send for Square
impl Sync for Square
impl Unpin for Square
impl UnsafeUnpin for Square
impl UnwindSafe for Square
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more