#[non_exhaustive]pub struct GameDef {
pub slug: String,
pub uuid: String,
pub meta: Meta,
pub distributions: Vec<Distribution>,
pub profiles: Vec<GameProfile>,
}Expand description
A single game’s definition.
#[non_exhaustive]: fields may be added as the ecosystem schema grows.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.slug: StringThe Thunderstore community slug.
uuid: StringThe schema’s stable identifier for this game.
meta: MetaDisplay metadata (name, icon).
distributions: Vec<Distribution>Store distributions (Steam/Epic/etc.) at the game level.
profiles: Vec<GameProfile>Per-manager profiles, one per r2modman entry. Most games have one. A few
have more: a dedicated server (Risk of Rain 2, Valheim) or a second game
edition with its own folder (Outward’s OutwardDe).
Implementations§
Source§impl GameDef
impl GameDef
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
The human-readable display name of the game.
Sourcepub fn profile(&self) -> Option<&GameProfile>
pub fn profile(&self) -> Option<&GameProfile>
Returns the primary profile to route against: the first game-instance
profile, or the first profile of any kind.
Sourcepub fn r2modman_folders(&self) -> Vec<&str>
pub fn r2modman_folders(&self) -> Vec<&str>
Every distinct r2modman data folder this game’s profiles use (see
GameProfile::internal_folder_name), in entry order.
An importer of r2modman data reads <data root>/<folder>/profiles/ for
each one. A server entry can share its game’s folder (Risk of Rain 2,
Valheim), which then holds the profiles of both, while a second edition
can have its own (Outward has Outward and OutwardDe), so reading only
the primary profile’s folder misses profiles.
§Examples
use thunderstore_engine::ecosystem::Ecosystem;
let eco = Ecosystem::bundled();
assert_eq!(eco.game("valheim").unwrap().r2modman_folders(), ["Valheim"]);
assert_eq!(eco.game("outward").unwrap().r2modman_folders(), ["Outward", "OutwardDe"]);