#[non_exhaustive]pub struct Ankan {
pub own: [Tile; 4],
}Expand description
Closed Kan, formed by setting aside 4 tiles of the same kind in a player’s closed hand (暗槓). This can be done during this player’s own turn.
Declaring Ankan does not technically open one’s hand, although it is revealed to others.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.own: [Tile; 4]Implementations§
Source§impl Ankan
impl Ankan
pub const fn num(self) -> u8
pub const fn suit(self) -> u8
Sourcepub fn from_tiles(own: [Tile; 4]) -> Option<Self>
pub fn from_tiles(own: [Tile; 4]) -> Option<Self>
Constructs from 4 own tiles.
Sourcepub fn from_hand(hand: &TileSet37, tile: Tile) -> Option<Self>
pub fn from_hand(hand: &TileSet37, tile: Tile) -> Option<Self>
Constructs from the closed hand for the specified tile.
Sourcepub fn consume_from_hand(self, hand: &mut TileSet37)
pub fn consume_from_hand(self, hand: &mut TileSet37)
Removes all own tiles from the hand (where this was constructed from).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ankan
impl<'de> Deserialize<'de> for Ankan
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
impl Copy for Ankan
impl Eq for Ankan
impl StructuralPartialEq for Ankan
Auto Trait Implementations§
impl Freeze for Ankan
impl RefUnwindSafe for Ankan
impl Send for Ankan
impl Sync for Ankan
impl Unpin for Ankan
impl UnwindSafe for Ankan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more