fish_lib/lib.rs
1//! # Fish Lib
2//!
3//! A library for fish-based games.
4//!
5//! ## Getting Started
6//!
7//! The main entry point is [`crate::game::Game`]. That's where you will find the public API to the game and storage logic.
8//!
9//! ```rust
10//! use std::env;
11//! use fish_lib::config::{Config, ConfigBuilderInterface};
12//! use fish_lib::game::prelude::*;
13//! use fish_lib::game::service_provider::ServiceProviderInterface;
14//!
15//! let config = Config::builder()/*. ...() */.build().unwrap();
16//!
17//! // Create game and clear database for a blank test state
18//! let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
19//! let game = Game::new(&database_url, Some(config)).unwrap();
20//! game.database().write().unwrap().clear().unwrap();
21//!
22//! // Example of basic usage, registering a user
23//! let user = game.user_register(1337).unwrap();
24//!
25//! // Re-find registered user
26//! let found_user = game.user_find(1337).unwrap();
27//!
28//! assert_eq!(user, found_user);
29//! ```
30//!
31//! ## Core Modules
32//!
33//! - [`game`] - The primary module containing all game functionality
34//! - [`config`] - Configuration types
35//! - [`data`] - Supporting data structures
36
37pub mod config;
38pub mod data;
39pub mod database;
40mod dto;
41pub mod enums;
42pub mod game;
43pub mod models;
44pub mod schema;
45#[cfg(test)]
46pub mod tests;
47pub mod traits;
48pub mod utils;