Skip to main content

game_stream

Function game_stream 

Source
pub async fn game_stream(
    server_state: ServerState,
    game_id: GameId,
) -> Result<impl Stream<Item = Game>, ServerError>
Expand description

Streams updates for a specific game.

This function returns a stream of Game objects representing changes to the specified game. Each item in the stream reflects the current state of the game after a change (creation, update, or deletion).

§Parameters

  • server_state: The shared server state, including the database change broadcaster.
  • game_id: The ID of the game to track.

§Returns

A Stream of Games wrapped in Result. Errors may occur due to internal server issues, in which case a ServerError is returned.