pub struct SelectHand(/* private fields */);Implementations§
Source§impl SelectHand
impl SelectHand
pub fn new(cards: Vec<Card>) -> Self
pub fn push(&mut self, c: Card)
pub fn append(&mut self, cards: Vec<Card>)
pub fn truncate(&mut self, len: usize)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn values(&self) -> Vec<Value>
pub fn cards(&self) -> Vec<Card>
pub fn values_freq(&self) -> IndexMap<Value, Vec<Card>>
pub fn suits(&self) -> Vec<Suit>
pub fn suits_freq(&self) -> IndexMap<Suit, Vec<Card>>
Sourcepub fn best_hand(&self) -> Result<MadeHand, PlayHandError>
pub fn best_hand(&self) -> Result<MadeHand, PlayHandError>
Can play any number of cards, it is our responsibility to determine the best hand. Higher tier hands take precedence over lower tier hands regardless of their level or scoring. For example, if hand is Kd Kd Kd Kd 2d, best hand will be a
pub fn is_highcard(&self) -> Option<SelectHand>
pub fn is_pair(&self) -> Option<SelectHand>
pub fn is_two_pair(&self) -> Option<SelectHand>
pub fn is_three_of_kind(&self) -> Option<SelectHand>
pub fn is_straight(&self) -> Option<SelectHand>
pub fn is_flush(&self) -> Option<SelectHand>
pub fn is_fullhouse(&self) -> Option<SelectHand>
pub fn is_four_of_kind(&self) -> Option<SelectHand>
pub fn is_straight_flush(&self) -> Option<SelectHand>
pub fn is_royal_flush(&self) -> Option<SelectHand>
pub fn is_five_of_kind(&self) -> Option<SelectHand>
pub fn is_flush_house(&self) -> Option<SelectHand>
pub fn is_flush_five(&self) -> Option<SelectHand>
Trait Implementations§
Source§impl Clone for SelectHand
impl Clone for SelectHand
Source§fn clone(&self) -> SelectHand
fn clone(&self) -> SelectHand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectHand
impl Debug for SelectHand
Source§impl Default for SelectHand
impl Default for SelectHand
Source§impl<'de> Deserialize<'de> for SelectHand
impl<'de> Deserialize<'de> for SelectHand
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 Display for SelectHand
impl Display for SelectHand
Source§impl Hash for SelectHand
impl Hash for SelectHand
Source§impl PartialEq for SelectHand
impl PartialEq for SelectHand
Source§impl Serialize for SelectHand
impl Serialize for SelectHand
impl Eq for SelectHand
impl StructuralPartialEq for SelectHand
Auto Trait Implementations§
impl Freeze for SelectHand
impl RefUnwindSafe for SelectHand
impl Send for SelectHand
impl Sync for SelectHand
impl Unpin for SelectHand
impl UnwindSafe for SelectHand
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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