pub struct MinesweeperGame { /* private fields */ }Expand description
High-level minesweeper game client that manages game state locally
Implementations§
Source§impl MinesweeperGame
impl MinesweeperGame
Sourcepub async fn subscribe_to_events(&self) -> UnboundedReceiver<GameEvent>
pub async fn subscribe_to_events(&self) -> UnboundedReceiver<GameEvent>
Subscribe to game events. Returns a receiver for game events.
Sourcepub async fn start_game(&self, params: GameParams) -> Result<()>
pub async fn start_game(&self, params: GameParams) -> Result<()>
Start a new game with the specified parameters
pub async fn join_game(&self, game_id: String) -> Result<()>
Sourcepub async fn restart(&self, params: GameParams) -> Result<()>
pub async fn restart(&self, params: GameParams) -> Result<()>
Restart the game with new parameters
Sourcepub async fn get_game_id(&self) -> Option<String>
pub async fn get_game_id(&self) -> Option<String>
Get the game ID
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if we’re connected to a game
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Close the connection and clean up
Auto Trait Implementations§
impl !RefUnwindSafe for MinesweeperGame
impl !UnwindSafe for MinesweeperGame
impl Freeze for MinesweeperGame
impl Send for MinesweeperGame
impl Sync for MinesweeperGame
impl Unpin for MinesweeperGame
impl UnsafeUnpin for MinesweeperGame
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