[core] API: compiling Seam 1 skeleton (types, signatures, stubs)

This commit is contained in:
2026-11-22 22:58:26 +01:00
parent 8f2bf986af
commit 5c17aac8d4
19 changed files with 1084 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Domi games: Atrium registry entries with `kind = "game"`, launched through their `domi-<app>://open` link, or
//! web games (Rosea, Moin) opened by URL.
use crate::error::ParseError;
use crate::model::Game;
/// How a Domi game starts.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DomiLaunch<'a> {
/// `domi-<app>://open`; `app` follows the Atrium id rules.
Link { app: &'a str },
/// A web game: `https://` only, the host must be one of `allowed_hosts`.
Web { url: &'a str, allowed_hosts: &'a [&'a str] },
}
/// The game for one Domi entry. `id` follows the Atrium id rules (`[a-z0-9-]{1,32}`, no `-` at either end) and
/// becomes `domi:<id>`; `name` is the title. No install folder.
pub fn game(id: &str, name: &str, launch: DomiLaunch<'_>) -> Result<Game, ParseError> {
let _ = (id, name, launch);
Err(ParseError::BadId)
}