pub struct MinesweeperClient { /* private fields */ }Expand description
HTTP client for minesweeper server API
Implementations§
Source§impl MinesweeperClient
impl MinesweeperClient
Sourcepub fn new(base_url: &str) -> Result<Self>
pub fn new(base_url: &str) -> Result<Self>
Create a new client connecting to the specified server URL
Sourcepub async fn create_game(&self, params: GameParams) -> Result<String>
pub async fn create_game(&self, params: GameParams) -> Result<String>
Create a new game with the specified parameters Returns the game ID that can be used to connect via WebSocket
Sourcepub fn websocket_url(&self, game_id: &str) -> Result<String>
pub fn websocket_url(&self, game_id: &str) -> Result<String>
Get the WebSocket URL for a game
Auto Trait Implementations§
impl !RefUnwindSafe for MinesweeperClient
impl !UnwindSafe for MinesweeperClient
impl Freeze for MinesweeperClient
impl Send for MinesweeperClient
impl Sync for MinesweeperClient
impl Unpin for MinesweeperClient
impl UnsafeUnpin for MinesweeperClient
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