Enum poker::EvalClass [−][src]
A utility enumeration type for pattern matching against the result of
Eval::class
. Each variant represents a class of
poker hand. Royal flush is not included, but can be matched against
EvalClass:StraightFlush { high_card: Rank::Ace }
if desired.
Example
use poker::{cards, Evaluator, EvalClass, Rank}; let hand = cards!( Ace of Clubs, Two of Spades, Three of Diamonds, Four of Diamonds, Five of Clubs, ); let eval = Evaluator::new(); let result = eval.evaluate(&hand).expect("couldn't evaluate hand"); assert!(matches!(result.class(), EvalClass::Straight { high_rank: Rank::Five }));
Variants
A high card, or no hand.
Fields of HighCard
high_rank: Rank
The high card rank.
A pair, two cards of the same rank
Fields of Pair
pair: Rank
The ranks of the pair.
Two pair. two cards of the same rank and two other cards of the same but distinct rank
Fields of TwoPair
Three of a kind, three cards of the same rank. Sometimes called trips.
Fields of ThreeOfAKind
trips: Rank
The ranks of the trips.
A straight, five cards in rank order. Straights go from A2345 to TJQKA.
Fields of Straight
high_rank: Rank
The rank of the highest card in the straight.
A flush, five cards of the same suit.
Fields of Flush
high_rank: Rank
The rank of the highest card in the flush.
A full house, one pair and one three of a kind
Fields of FullHouse
Four of a kind, four cards of the same rank. Sometimes called quads.
Fields of FourOfAKind
quads: Rank
The rank of the quads.
A straight flush, like a straight but all the cards are of the same suit.
Fields of StraightFlush
high_rank: Rank
The rank of the highest card in the straight flush.
Trait Implementations
impl Clone for EvalClass
[src]
impl Copy for EvalClass
[src]
impl Debug for EvalClass
[src]
impl Eq for EvalClass
[src]
impl Ord for EvalClass
[src]
fn cmp(&self, other: &EvalClass) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<EvalClass> for EvalClass
[src]
impl PartialOrd<EvalClass> for EvalClass
[src]
fn partial_cmp(&self, other: &EvalClass) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for EvalClass
[src]
impl StructuralPartialEq for EvalClass
[src]
Auto Trait Implementations
impl RefUnwindSafe for EvalClass
impl Send for EvalClass
impl Sync for EvalClass
impl Unpin for EvalClass
impl UnwindSafe for EvalClass
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,