Struct poker::Eval [−][src]
pub struct Eval(_);
The result of a successful poker hand evaluation. When printed in
Display
format, shows the proper, qualified name of the poker hand.
Example
use poker::{cards, Evaluator}; let hand = cards!("7c 8d 3s Ks 7h") .try_collect::<Vec<_>>() .expect("couldn't parse cards"); let eval = Evaluator::new(); let result = eval.evaluate(hand).expect("couldn't evaluate hand"); assert_eq!(result.to_string(), "Pair, sevens"); assert!(result.is_pair());
Implementations
impl Eval
[src]
pub const BEST: Self
[src]
The best possible poker hand, a royal flush.
pub const WORST: Self
[src]
The worst possible poker hand, a seven-high.
pub const fn class(self) -> EvalClass
[src]
The class of poker hand that was evaluated. Useful for pattern matching
as opposed to checking with an is_x()
method.
pub const fn is_high_card(self) -> bool
[src]
Check whether this hand is a high-card.
pub const fn is_pair(self) -> bool
[src]
Check whether this hand is a pair.
pub const fn is_two_pair(self) -> bool
[src]
Check whether this hand is a two-pair.
pub const fn is_three_of_a_kind(self) -> bool
[src]
Check whether this hand is a three-of-a-kind.
pub const fn is_straight(self) -> bool
[src]
Check whether this hand is a straight.
pub const fn is_flush(self) -> bool
[src]
Check whether this hand is a flush.
pub const fn is_full_house(self) -> bool
[src]
Check whether this hand is a full house.
pub const fn is_four_of_a_kind(self) -> bool
[src]
Check whether this hand is a four-of-a-kind.
pub const fn is_straight_flush(self) -> bool
[src]
Check whether this hand is a straight flush.
pub const fn is_royal_flush(self) -> bool
[src]
Check whether this hand is a royal flush.
Trait Implementations
impl Clone for Eval
[src]
impl Copy for Eval
[src]
impl Debug for Eval
[src]
impl Display for Eval
[src]
impl Eq for Eval
[src]
impl Hash for Eval
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Eval
[src]
fn cmp(&self, other: &Eval) -> 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<Eval> for Eval
[src]
impl PartialOrd<Eval> for Eval
[src]
fn partial_cmp(&self, other: &Eval) -> 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 Eval
[src]
impl StructuralPartialEq for Eval
[src]
Auto Trait Implementations
impl RefUnwindSafe for Eval
impl Send for Eval
impl Sync for Eval
impl Unpin for Eval
impl UnwindSafe for Eval
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> CallHasher for T where
T: Hash + ?Sized,
T: Hash + ?Sized,
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
H: Hash + ?Sized,
B: BuildHasher,
H: Hash + ?Sized,
B: BuildHasher,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,