Enum stochasta::playing_cards::PlayingCardValue
source · pub enum PlayingCardValue {
Show 13 variants
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Queen,
King,
Ace,
}
Expand description
The value of a playing card.
Variants§
Implementations§
source§impl PlayingCardValue
impl PlayingCardValue
sourcepub fn is_picture(&self) -> bool
pub fn is_picture(&self) -> bool
Returns true
if the value is J, Q or K.
§Example
use stochasta::playing_cards::PlayingCardValue;
assert_eq!(PlayingCardValue::King.is_picture(), true);
assert_eq!(PlayingCardValue::Ace.is_picture(), false);
assert_eq!(PlayingCardValue::Two.is_picture(), false);
sourcepub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Returns true
if the value is numeric (2-10).
§Example
use stochasta::playing_cards::PlayingCardValue;
assert_eq!(PlayingCardValue::Two.is_number(), true);
assert_eq!(PlayingCardValue::King.is_number(), false);
assert_eq!(PlayingCardValue::Ace.is_number(), false);
Trait Implementations§
source§impl<O: Into<EnumSet<PlayingCardValue>>> BitAnd<O> for PlayingCardValue
impl<O: Into<EnumSet<PlayingCardValue>>> BitAnd<O> for PlayingCardValue
source§impl<O: Into<EnumSet<PlayingCardValue>>> BitOr<O> for PlayingCardValue
impl<O: Into<EnumSet<PlayingCardValue>>> BitOr<O> for PlayingCardValue
source§impl<O: Into<EnumSet<PlayingCardValue>>> BitXor<O> for PlayingCardValue
impl<O: Into<EnumSet<PlayingCardValue>>> BitXor<O> for PlayingCardValue
source§impl Clone for PlayingCardValue
impl Clone for PlayingCardValue
source§impl Debug for PlayingCardValue
impl Debug for PlayingCardValue
source§impl Default for PlayingCardValue
impl Default for PlayingCardValue
source§fn default() -> PlayingCardValue
fn default() -> PlayingCardValue
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for PlayingCardValue
impl<'de> Deserialize<'de> for PlayingCardValue
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for PlayingCardValue
impl Display for PlayingCardValue
source§impl EnumSetTypePrivate for PlayingCardValue
impl EnumSetTypePrivate for PlayingCardValue
source§const ALL_BITS: Self::Repr = {transmute(0x1fff): <playing_cards::playing_card_value::PlayingCardValue as enumset::__internal::EnumSetTypePrivate>::Repr}
const ALL_BITS: Self::Repr = {transmute(0x1fff): <playing_cards::playing_card_value::PlayingCardValue as enumset::__internal::EnumSetTypePrivate>::Repr}
A mask of bits that are valid in the bitset.
source§const VARIANT_COUNT: u32 = 13u32
const VARIANT_COUNT: u32 = 13u32
The number of variants in the bitset.
source§fn enum_into_u32(self) -> u32
fn enum_into_u32(self) -> u32
Converts an enum of this type into its bit position.
source§unsafe fn enum_from_u32(val: u32) -> Self
unsafe fn enum_from_u32(val: u32) -> Self
Converts a bit position into an enum value.
source§fn serialize<S: Serializer>(
set: EnumSet<PlayingCardValue>,
ser: S
) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>( set: EnumSet<PlayingCardValue>, ser: S ) -> Result<S::Ok, S::Error>
Serializes the
EnumSet
. Read moresource§fn deserialize<'de, D: Deserializer<'de>>(
de: D
) -> Result<EnumSet<PlayingCardValue>, D::Error>
fn deserialize<'de, D: Deserializer<'de>>( de: D ) -> Result<EnumSet<PlayingCardValue>, D::Error>
Deserializes the
EnumSet
.source§impl Hash for PlayingCardValue
impl Hash for PlayingCardValue
source§impl Not for PlayingCardValue
impl Not for PlayingCardValue
source§impl Ord for PlayingCardValue
impl Ord for PlayingCardValue
source§fn cmp(&self, other: &PlayingCardValue) -> Ordering
fn cmp(&self, other: &PlayingCardValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<EnumSet<PlayingCardValue>> for PlayingCardValue
impl PartialEq<EnumSet<PlayingCardValue>> for PlayingCardValue
source§impl PartialEq for PlayingCardValue
impl PartialEq for PlayingCardValue
source§impl PartialOrd for PlayingCardValue
impl PartialOrd for PlayingCardValue
source§fn partial_cmp(&self, other: &PlayingCardValue) -> Option<Ordering>
fn partial_cmp(&self, other: &PlayingCardValue) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for PlayingCardValue
impl Serialize for PlayingCardValue
source§impl<O: Into<EnumSet<PlayingCardValue>>> Sub<O> for PlayingCardValue
impl<O: Into<EnumSet<PlayingCardValue>>> Sub<O> for PlayingCardValue
impl Copy for PlayingCardValue
impl EnumSetType for PlayingCardValue
impl Eq for PlayingCardValue
Auto Trait Implementations§
impl Freeze for PlayingCardValue
impl RefUnwindSafe for PlayingCardValue
impl Send for PlayingCardValue
impl Sync for PlayingCardValue
impl Unpin for PlayingCardValue
impl UnwindSafe for PlayingCardValue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more