pub struct HandRank {
pub value: HandRankValue,
pub name: HandRankName,
pub class: HandRankClass,
}Expand description
HandRank represents the value of a specific 5 card hand of poker. The lower the
HandRankValue the better the hand. When a HandRank is instantiated it can only
have a specific matching HandRankName and HandRankValue.
Fields§
§value: HandRankValue§name: HandRankName§class: HandRankClassImplementations§
Source§impl HandRank
impl HandRank
Sourcepub fn determine_name(hrv: &HandRankValue) -> HandRankName
pub fn determine_name(hrv: &HandRankValue) -> HandRankName
Takes in a calculated HandRankValue and returns the HandRank.
7462 possible combination of hands:
10 straight-flushes 156 four of a kinds 156 full houses 1277 flushes 10 straights 858 three of a kinds 858 two pairs 2860 pairs 1277 high cards
pub fn determine_class(hrv: &HandRankValue) -> HandRankClass
pub fn is_a_valid_hand_rank(&self) -> bool
pub fn is_invalid(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HandRank
impl<'de> Deserialize<'de> for HandRank
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<u16> for HandRank
impl From<u16> for HandRank
Source§fn from(value: HandRankValue) -> Self
fn from(value: HandRankValue) -> Self
Converts to this type from the input type.
Source§impl Ord for HandRank
The lower the HandRankValue the higher the value of the HandRank, unless it’s invalid.
impl Ord for HandRank
The lower the HandRankValue the higher the value of the HandRank, unless it’s invalid.
Source§impl PartialOrd for HandRank
impl PartialOrd for HandRank
impl Copy for HandRank
impl Eq for HandRank
impl StructuralPartialEq for HandRank
Auto Trait Implementations§
impl Freeze for HandRank
impl RefUnwindSafe for HandRank
impl Send for HandRank
impl Sync for HandRank
impl Unpin for HandRank
impl UnwindSafe for HandRank
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