Skip to main content

Card

Struct Card 

Source
pub struct Card { /* private fields */ }
Expand description

A single card

Implementations§

Source§

impl Card

This module defines card constants

Source

pub const C2: Card

2 of Clubs

Source

pub const C3: Card

3 of Clubs

Source

pub const C4: Card

4 of Clubs

Source

pub const C5: Card

5 of Clubs

Source

pub const C6: Card

6 of Clubs

Source

pub const C7: Card

7 of Clubs

Source

pub const C8: Card

8 of Clubs

Source

pub const C9: Card

9 of Clubs

Source

pub const C10: Card

10 of Clubs

Source

pub const CJ: Card

Jack of Clubs

Source

pub const CQ: Card

Queen of Clubs

Source

pub const CK: Card

King of Clubs

Source

pub const CA: Card

Ace of Clubs

Source

pub const D2: Card

2 of Diamonds

Source

pub const D3: Card

3 of Diamonds

Source

pub const D4: Card

4 of Diamonds

Source

pub const D5: Card

5 of Diamonds

Source

pub const D6: Card

6 of Diamonds

Source

pub const D7: Card

7 of Diamonds

Source

pub const D8: Card

8 of Diamonds

Source

pub const D9: Card

9 of Diamonds

Source

pub const D10: Card

10 of Diamonds

Source

pub const DJ: Card

Jack of Diamonds

Source

pub const DQ: Card

Queen of Diamonds

Source

pub const DK: Card

King of Diamonds

Source

pub const DA: Card

Ace of Diamonds

Source

pub const H2: Card

2 of Hearts

Source

pub const H3: Card

3 of Hearts

Source

pub const H4: Card

4 of Hearts

Source

pub const H5: Card

5 of Hearts

Source

pub const H6: Card

6 of Hearts

Source

pub const H7: Card

7 of Hearts

Source

pub const H8: Card

8 of Hearts

Source

pub const H9: Card

9 of Hearts

Source

pub const H10: Card

10 of Hearts

Source

pub const HJ: Card

Jack of Hearts

Source

pub const HQ: Card

Queen of Hearts

Source

pub const HK: Card

King of Hearts

Source

pub const HA: Card

Ace of Hearts

Source

pub const S2: Card

2 of Spades

Source

pub const S3: Card

3 of Spades

Source

pub const S4: Card

4 of Spades

Source

pub const S5: Card

5 of Spades

Source

pub const S6: Card

6 of Spades

Source

pub const S7: Card

7 of Spades

Source

pub const S8: Card

8 of Spades

Source

pub const S9: Card

9 of Spades

Source

pub const S10: Card

10 of Spades

Source

pub const SJ: Card

Jack of Spades

Source

pub const SQ: Card

Queen of Spades

Source

pub const SK: Card

King of Spades

Source

pub const SA: Card

Ace of Spades

Source

pub const fn new(suit: Suit, rank: u8) -> Card

Create a new card with given rank and suit.

Source

pub const fn suit(self) -> Suit

What is the Suit?

Source

pub const fn rank(self) -> u8

What is my rank?

Trait Implementations§

Source§

impl Clone for Card

Source§

fn clone(&self) -> Card

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Card

Source§

impl Debug for Card

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Card

Source§

impl PartialEq for Card

Source§

fn eq(&self, other: &Card) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Card

Auto Trait Implementations§

§

impl Freeze for Card

§

impl RefUnwindSafe for Card

§

impl Send for Card

§

impl Sync for Card

§

impl Unpin for Card

§

impl UnsafeUnpin for Card

§

impl UnwindSafe for Card

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V