pub struct GameBoxMeta {
pub name: String,
pub version: String,
pub author: String,
pub category: String,
pub description: String,
pub safe_name: Option<String>,
pub gamebox: GameBoxSection,
pub judge: Option<JudgeManifest>,
pub awdp: Option<AwdpManifest>,
}Expand description
GameBox 包顶层清单(meta.toml)。
亦导出为 GameBoxManifest。
Fields§
§name: String§version: StringAuthor package version (SemVer, no build metadata). Becomes the image tag suffix.
category: String§description: String§safe_name: Option<String>Optional stable slug. When omitted, derived via derive_safe_name.
gamebox: GameBoxSection§judge: Option<JudgeManifest>Optional trusted judge script reference (never part of Docker build context).
awdp: Option<AwdpManifest>Optional AWD-P exploit script reference (never part of Docker build context).
Implementations§
Source§impl GameBoxMeta
impl GameBoxMeta
Sourcepub fn from_toml_str(toml_str: &str) -> Result<Self, GameBoxMetaError>
pub fn from_toml_str(toml_str: &str) -> Result<Self, GameBoxMetaError>
Parse TOML only (no semantic validation). Unknown fields fail via
deny_unknown_fields.
Sourcepub fn parse_and_validate(toml_str: &str) -> Result<Self, GameBoxMetaError>
pub fn parse_and_validate(toml_str: &str) -> Result<Self, GameBoxMetaError>
Parse + semantic validation.
Sourcepub fn resolved_safe_name(&self) -> Result<String, GameBoxMetaError>
pub fn resolved_safe_name(&self) -> Result<String, GameBoxMetaError>
Resolve safe_name: explicit value, or derived from name.
Sourcepub fn validate(&self) -> Result<(), GameBoxMetaError>
pub fn validate(&self) -> Result<(), GameBoxMetaError>
Semantic validation (ports, paths, version, safe_name, judge, resources, dupes).
Sourcepub fn normalize(&self) -> Result<NormalizedGameBoxSpec, GameBoxMetaError>
pub fn normalize(&self) -> Result<NormalizedGameBoxSpec, GameBoxMetaError>
Produce a canonical, fully-materialised spec (sorted healthchecks, defaults filled).
Callers should validate() first; this method also validates.
Trait Implementations§
Source§impl Clone for GameBoxMeta
impl Clone for GameBoxMeta
Source§fn clone(&self) -> GameBoxMeta
fn clone(&self) -> GameBoxMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GameBoxMeta
impl Debug for GameBoxMeta
Source§impl<'de> Deserialize<'de> for GameBoxMeta
impl<'de> Deserialize<'de> for GameBoxMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GameBoxMeta
Source§impl PartialEq for GameBoxMeta
impl PartialEq for GameBoxMeta
Source§impl Serialize for GameBoxMeta
impl Serialize for GameBoxMeta
impl StructuralPartialEq for GameBoxMeta
Auto Trait Implementations§
impl Freeze for GameBoxMeta
impl RefUnwindSafe for GameBoxMeta
impl Send for GameBoxMeta
impl Sync for GameBoxMeta
impl Unpin for GameBoxMeta
impl UnsafeUnpin for GameBoxMeta
impl UnwindSafe for GameBoxMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more