Skip to main content

pacenotes_shared/
lib.rs

1//! Protocol types shared between the installer and the server.
2//!
3//! Serde types only: no I/O, no async, no HTTP. Timestamps are unix seconds.
4//! Any change here is a protocol change and lands on both sides in one PR.
5//!
6//! A package's address is `<data>/<game>/packages/<directory>/<name>.zip`.
7//! `directory` decides who may see it (`PUBLIC_DIR` is everyone's), and
8//! `name` is its path under that directory, which is also its place in the
9//! installer's tree: `codriver/polish/male/Kamil` is category `codriver`,
10//! levels `polish` → `male`, leaf `Kamil`. Both stay lookup keys that are
11//! never joined onto a filesystem path.
12
13mod access;
14mod api_error;
15mod category;
16mod conflict_report;
17mod download_path;
18mod game;
19mod game_schema;
20mod key_status;
21mod lookup_key;
22mod manifest;
23mod package;
24mod package_ref;
25
26#[cfg(test)]
27mod fixtures;
28
29pub use access::{AUTH_HEADER, BEARER_PREFIX, PUBLIC_DIR};
30pub use api_error::ApiError;
31pub use category::{
32    CATEGORY_CODRIVER, CATEGORY_LANGUAGE, CATEGORY_PACENOTES, CATEGORY_STYLE, CHOICE_CATEGORIES,
33    KNOWN_CATEGORIES,
34};
35pub use conflict_report::{Conflict, ConflictReport};
36pub use download_path::{category_of_download_path, split_download_path};
37pub use game::{
38    default_game, GAME_ASSETTOCORSA, GAME_BEAMNG, GAME_DIRT_RALLY2, GAME_RBR, KNOWN_GAMES,
39};
40pub use game_schema::{
41    GameSchema, SchemaCategory, INSTALL_ROOT_GAME, SCHEMA_FILE, SELECT_ANY, SELECT_ONE,
42};
43pub use key_status::KeyStatus;
44pub use lookup_key::{valid_id, valid_name};
45pub use manifest::Manifest;
46pub use package::PackageInfo;
47pub use package_ref::PackageRef;