pub enum Message {
Show 18 variants
JoinServer {
nickname: String,
},
ServerJoined {
nickname: String,
chips: Chips,
},
JoinTable,
LeaveTable,
TableJoined {
table_id: TableId,
chips: Chips,
seats: u8,
},
NoTablesLeft,
NotEnoughChips,
PlayerAlreadyJoined,
PlayerJoined {
player_id: PeerId,
nickname: String,
chips: Chips,
},
ShowAccount {
chips: Chips,
},
StartGame(Vec<PeerId>),
StartHand,
EndHand {
payoffs: Vec<HandPayoff>,
board: Vec<Card>,
cards: Vec<(PeerId, PlayerCards)>,
},
DealCards(Card, Card),
PlayerLeft(PeerId),
GameUpdate {
players: Vec<PlayerUpdate>,
board: Vec<Card>,
pot: Chips,
},
ActionRequest {
player_id: PeerId,
min_raise: Chips,
big_blind: Chips,
actions: Vec<PlayerAction>,
},
ActionResponse {
action: PlayerAction,
amount: Chips,
},
}Expand description
Message exchanged by a client and a server.
Variants§
JoinServer
Joins a server with a nickname.
ServerJoined
A player account information.
JoinTable
Join a table.
LeaveTable
Leave a table.
TableJoined
Table joined confirmation.
Fields
NoTablesLeft
There are no tables left.
NotEnoughChips
The player doesn’t have enough chips to join a game.
PlayerAlreadyJoined
The player has already joined a table.
PlayerJoined
A player joined the table.
Fields
ShowAccount
Show the account dialog.
StartGame(Vec<PeerId>)
Tell players the game is starting and update the seats order.
StartHand
Tell players to prepare for a new hand.
EndHand
Tell players the hand has completed and who won.
Fields
§
payoffs: Vec<HandPayoff>List of payoffs for the hand.
§
cards: Vec<(PeerId, PlayerCards)>Players cards.
DealCards(Card, Card)
Deal cards to a player.
PlayerLeft(PeerId)
A player left the table.
GameUpdate
A game state update.
Fields
§
players: Vec<PlayerUpdate>The players update.
ActionRequest
Request action from a player.
Fields
§
actions: Vec<PlayerAction>The list of legal actions.
ActionResponse
Player action response.
Fields
§
action: PlayerActionThe action from the player.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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