[−][src]Enum rs_poker::core::Value
Card rank or value. This is basically the face value - 2
Variants
2
3
4
5
6
7
8
9
T
J
Q
K
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]
fn cmp(&self, other: &Value) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Value> for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Debug for Value
[src]
impl Hash for Value
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,