[][src]Enum rs_poker::core::Value

pub enum Value {
    Two,
    Three,
    Four,
    Five,
    Six,
    Seven,
    Eight,
    Nine,
    Ten,
    Jack,
    Queen,
    King,
    Ace,
}

Card rank or value. This is basically the face value - 2

Variants

Two

2

Three

3

Four

4

Five

5

Six

6

Seven

7

Eight

8

Nine

9

Ten

T

Jack

J

Queen

Q

King

K

Ace

A

Methods

impl Value[src]

#[must_use] pub fn from_u8(v: u8) -> Self[src]

Take a u32 and convert it to a value.

Examples

use rs_poker::core::Value;
assert_eq!(Value::Four, Value::from_u8(Value::Four as u8));

#[must_use] pub fn values() -> [Self; 13][src]

Get all of the Value's that are possible. This is used to iterate through all possible values when creating a new deck, or generating all possible starting hands.

#[must_use] pub fn from_char(c: char) -> Option<Self>[src]

Given a character parse that char into a value. Case is ignored as long as the char is in the ascii range (It should be). @returns None if there's no value there.

Examples

use rs_poker::core::Value;

assert_eq!(Value::Ace, Value::from_char('A').unwrap());

#[must_use] pub fn to_char(self) -> char[src]

Convert this Value to a char.

#[must_use] pub fn gap(self, other: Self) -> u8[src]

How card ranks seperate the two values.

Examples

use rs_poker::core::Value;
assert_eq!(1, Value::Ace.gap(Value::King));

Trait Implementations

impl Clone for Value[src]

impl Copy for Value[src]

impl Eq for Value[src]

impl Ord for Value[src]

impl PartialEq<Value> for Value[src]

impl PartialOrd<Value> for Value[src]

impl Debug for Value[src]

impl Hash for Value[src]

impl StructuralPartialEq for Value[src]

impl StructuralEq for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

impl RefUnwindSafe for Value

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]