pub enum Suit {
S = 0,
H = 1,
D = 2,
C = 3,
}Expand description
Enum for Suits
Represents the four suits in a standard deck of playing cards. Suits are ordered Spades < Hearts < Diamonds < Clubs for consistent comparison. Each suit has a unique numeric value (0-3) and character representation.
§Examples
use open_pql::{Suit, Suit::*};
let suit = S; // Spades
assert_eq!(suit.to_string(), "s");
assert_eq!(suit as u8, 0);
let parsed: Suit = "h".parse().unwrap();
assert_eq!(parsed, H);Variants§
Implementations§
Trait Implementations§
Source§impl Ord for Suit
impl Ord for Suit
Source§impl PartialOrd for Suit
impl PartialOrd for Suit
impl Copy for Suit
impl Eq for Suit
impl StructuralPartialEq for Suit
Auto Trait Implementations§
impl Freeze for Suit
impl RefUnwindSafe for Suit
impl Send for Suit
impl Sync for Suit
impl Unpin for Suit
impl UnwindSafe for Suit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more