pub struct Step { /* private fields */ }Expand description
One checker movement using one die.
Implementations§
Source§impl Step
impl Step
Sourcepub fn new(from: Location, to: Location, die: u8) -> Result<Self, StepError>
pub fn new(from: Location, to: Location, die: u8) -> Result<Self, StepError>
Creates a structurally valid checker step.
This does not test the step against a position. Use crate::Turn or
crate::Position::play when game-rule validation is required.
pub const fn from(self) -> Location
pub const fn to(self) -> Location
pub const fn die(self) -> u8
Trait Implementations§
impl Copy for Step
impl Eq for Step
Source§impl Ord for Step
impl Ord for Step
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 Step
impl PartialOrd for Step
impl StructuralPartialEq for Step
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnsafeUnpin for Step
impl UnwindSafe for Step
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