pub struct Column(/* private fields */);Expand description
One of Connect Four’s seven columns, indexed left to right.
Implementations§
Source§impl Column
impl Column
pub const COUNT: usize = 7
Sourcepub const fn new(index: u8) -> Self
pub const fn new(index: u8) -> Self
Creates a column from its zero-based left-to-right index.
§Panics
Panics when index is greater than six.
pub const fn index(self) -> usize
pub const fn mirrored(self) -> Self
pub fn all() -> impl Iterator<Item = Self>
Trait Implementations§
impl Copy for Column
impl Eq for Column
Source§impl Ord for Column
impl Ord for Column
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 Column
impl PartialOrd for Column
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
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