pub trait GameInterface {
// Required methods
fn get_user(external_id: i64) -> GameResult<User>;
fn register_user(external_id: i64) -> GameResult<User>;
fn user_catch_specific_specimen(
user: &User,
species_id: i32,
) -> GameResult<(Specimen, FishingHistoryEntry)>;
fn user_get_fishing_history(
user: &User,
species_id: i32,
) -> GameResult<FishingHistoryEntry>;
fn get_location_data(location_id: i32) -> GameResult<Arc<LocationData>>;
fn get_species_data(species_id: i32) -> GameResult<Arc<SpeciesData>>;
}Expand description
§Game Interface
The trait defining all available game operations. This interface is implemented
by the crate::game::Game struct to provide the actual game functionality. It serves as a
contract to ensure all required functionality is implemented and to prevent
accidental breaking changes.
Required Methods§
fn get_user(external_id: i64) -> GameResult<User>
fn register_user(external_id: i64) -> GameResult<User>
fn user_catch_specific_specimen( user: &User, species_id: i32, ) -> GameResult<(Specimen, FishingHistoryEntry)>
fn user_get_fishing_history( user: &User, species_id: i32, ) -> GameResult<FishingHistoryEntry>
fn get_location_data(location_id: i32) -> GameResult<Arc<LocationData>>
fn get_species_data(species_id: i32) -> GameResult<Arc<SpeciesData>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.