pub struct UserGameDTO {
pub name: String,
pub phase: PhaseDTO,
pub pending: PendingDTO,
pub dealer: Option<PlayerDTO>,
pub user_state: PlayerStateDTO,
pub opponent_state: PlayerStateDTO,
pub crib: Vec<CardDTO>,
pub starter_cut: Option<CardDTO>,
pub plays: Option<PlaysDTO>,
pub pegging: PeggingDTO,
pub winner: Option<PlayerDTO>,
}Expand description
A Data Transfer Object representing the full state of a game from the perspective of a user.
Fields§
§name: StringThe name of the game.
phase: PhaseDTOThe current phase of the game.
pending: PendingDTOIndicates which player(s) are pending an action.
dealer: Option<PlayerDTO>The player who is currently the dealer, if assigned.
user_state: PlayerStateDTOThe state of the user’s hand, cut (for deal), and score.
opponent_state: PlayerStateDTOThe state of the opponent’s hand, cut (for deal), and score.
crib: Vec<CardDTO>The cards currently in the crib.
starter_cut: Option<CardDTO>The starter cut card, if it has been revealed.
plays: Option<PlaysDTO>The current and previous plays for the round, if the round has started.
pegging: PeggingDTOA summary of pegging points for each kind of scoring of hands & crib. (A Playing phase doesn’t have a breakdown until the first scoring play).
winner: Option<PlayerDTO>The winner of the game, if the game has finished.
Trait Implementations§
Source§impl Clone for UserGameDTO
impl Clone for UserGameDTO
Source§fn clone(&self) -> UserGameDTO
fn clone(&self) -> UserGameDTO
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserGameDTO
impl Debug for UserGameDTO
Source§impl Default for UserGameDTO
impl Default for UserGameDTO
Source§fn default() -> UserGameDTO
fn default() -> UserGameDTO
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UserGameDTO
impl<'de> Deserialize<'de> for UserGameDTO
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 PartialEq for UserGameDTO
impl PartialEq for UserGameDTO
Source§impl Serialize for UserGameDTO
impl Serialize for UserGameDTO
impl Eq for UserGameDTO
impl StructuralPartialEq for UserGameDTO
Auto Trait Implementations§
impl Freeze for UserGameDTO
impl RefUnwindSafe for UserGameDTO
impl Send for UserGameDTO
impl Sync for UserGameDTO
impl Unpin for UserGameDTO
impl UnwindSafe for UserGameDTO
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice