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]

impl Ord for Eval[src]

impl PartialEq<Eval> for Eval[src]

impl PartialOrd<Eval> for Eval[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash + ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,