pub enum HandType {
HighCard,
Pair,
TwoPair,
Trips,
Straight,
Flush,
FullHouse,
Quads,
StraightFlush,
}Expand description
Represents the categorical type of a poker hand.
This enum classifies poker hands into their standard categories, ordered from weakest to strongest. It is used to quickly identify what type of hand a player has without considering the specific ranks involved.
§Ordering
The variants are ordered from weakest (HighCard) to strongest (StraightFlush),
matching standard poker hand rankings.
Variants§
HighCard
No matching cards (default/weakest hand type)
Pair
Two cards of the same rank
TwoPair
Two different pairs
Trips
Three cards of the same rank
Straight
Five cards in sequential rank
Flush
Five cards of the same suit
FullHouse
Three of a kind plus a pair
Quads
Four cards of the same rank
StraightFlush
Five cards in sequential rank, all of the same suit
Implementations§
Trait Implementations§
Source§impl From<HandRating> for HandType
impl From<HandRating> for HandType
Source§fn from(hand_ranking: HandRating) -> Self
fn from(hand_ranking: HandRating) -> Self
Extracts the categorical hand type from a HandRanking.
This implementation decodes the bit-packed HandRanking to determine
the hand type. It uses bit masking to identify the hand category from
the upper bits and additional bit checks to distinguish between hands
that share the same mask (e.g., Flush vs FullHouse, Quads vs StraightFlush).