pub struct Table { /* private fields */ }Expand description
Table state shared by all players who joined the table.
Implementations§
Source§impl Table
impl Table
Sourcepub fn new(
seats: usize,
sk: Arc<SigningKey>,
db: Db,
shutdown_broadcast_rx: Receiver<()>,
shutdown_complete_tx: Sender<()>,
) -> Self
pub fn new( seats: usize, sk: Arc<SigningKey>, db: Db, shutdown_broadcast_rx: Receiver<()>, shutdown_complete_tx: Sender<()>, ) -> Self
Creates a new table that manages players and game state.
Sourcepub async fn player_can_join(&self) -> bool
pub async fn player_can_join(&self) -> bool
Checks if a player can join the table.
Sourcepub async fn try_join(
&self,
player_id: &PeerId,
nickname: &str,
join_chips: Chips,
table_tx: Sender<TableMessage>,
) -> Result<(), TableJoinError>
pub async fn try_join( &self, player_id: &PeerId, nickname: &str, join_chips: Chips, table_tx: Sender<TableMessage>, ) -> Result<(), TableJoinError>
A player tried to join this table, returns true if the player joined.
Sourcepub async fn message(&self, msg: SignedMessage)
pub async fn message(&self, msg: SignedMessage)
Handle a message from a player.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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