Struct playing_cards::core::Card
source · pub struct Card {
pub value: Value,
pub suit: Suit,
}Expand description
A structural representation of a playing card
Fields§
§value: ValueThe Value of the Card
suit: SuitThe Suit of the Card
Implementations§
source§impl Card
impl Card
sourcepub fn vec_from_str(s: &str) -> Result<Vec<Card>, &str>
pub fn vec_from_str(s: &str) -> Result<Vec<Card>, &str>
Takes in a string and returns back a vector of Cards
This can be used to quickly static hands that can be evaluated for testing.
sourcepub fn to_int(&self) -> i32
pub fn to_int(&self) -> i32
Turns card into integer
This is typically used for when traversing the lookup table.
sourcepub fn calculate_bit_pattern(&self) -> u32
pub fn calculate_bit_pattern(&self) -> u32
Calculates the Catus-Kev bit pattern for the card
This can be useful for building custom hand evaluators. For poker-related hand evaluators, please see the poker module.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Card
impl<'de> Deserialize<'de> for Card
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 PartialEq<Card> for Card
impl PartialEq<Card> for Card
impl Copy for Card
impl Eq for Card
impl StructuralEq for Card
impl StructuralPartialEq for Card
Auto Trait Implementations§
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnwindSafe for Card
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