Expand description
§api
This crate exposes the HTTP API for the game server. Its main responsibilities are:
- Exposing HTTP endpoints for clients (web or other consumers).
- Providing DTOs (Data Transfer Objects) for communication.
- Translating between DTOs and server domain objects.
- Calling the appropriate server services to perform game logic.
§Modules
dto: Defines Data Transfer Objects for requests and responses.error: DefinesApiErrorand other API-level errors.services: Implements the core business logic for API endpoints.
§Server Integration
When compiled with the server feature, the crate exposes:
ServerStateExtractor: a wrapper aroundserver::ServerStatefor use by the API.initialize_server_state: function to initialize the shared server state.
Modules§
- action
- Actions that modify the game state.
- dto
- Data Transfer Object (DTO) definitions used by the
serviceslayer. - error
- Error types used throughout the
servicesmodule. - queries
- Queries that retrieve game or user data.
- stream
- Streaming endpoints for real-time updates.
Structs§
- Server
State Extractor - Alias for
ExtractedServerStateused in HTTP request handlers to extract the current server state. A wrapper aroundServerStateused for extracting the state in contexts such as HTTP request handlers or middleware.
Functions§
- initialize_
server_ state - Constructs the shared
ServerState.