#[repr(u8)]pub enum State {
Diminished = 0,
Normal = 1,
Enhanced = 2,
}Expand description
The state of a piece, encoded by the optional + / - prefix.
PIN standardizes only the encoding; what an enhanced or diminished state means in play is defined by the rule system (e.g. promotion, double-step eligibility, check status). The mapping is:
- no prefix →
State::Normal(the baseline), +prefix →State::Enhanced,-prefix →State::Diminished.
The total ordering runs along the natural spectrum
Diminished < Normal < Enhanced.
Variants§
Diminished = 0
Diminished state, encoded by the - prefix.
Normal = 1
Baseline state, encoded by the absence of any prefix.
Enhanced = 2
Enhanced state, encoded by the + prefix.
Trait Implementations§
Source§impl Ord for State
impl Ord for State
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
Source§impl PartialOrd for State
impl PartialOrd for State
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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