mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-22 17:44:22 +00:00
Model bundle metadata
This commit is contained in:
parent
199888dc25
commit
30d605ab5a
3 changed files with 38 additions and 0 deletions
32
src/schema/anybundle/metadata.rs
Normal file
32
src/schema/anybundle/metadata.rs
Normal file
|
@ -0,0 +1,32 @@
|
|||
/// The contents of the `anybundle.json` file of a bundle.
|
||||
///
|
||||
/// Both Core Bundles and Set Bundles are bundles, and both have anybundle.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
|
||||
pub struct BundleMetadata {
|
||||
/// The locales included in the bundle.
|
||||
///
|
||||
/// I've never seen more that a single locale here, but the specification allows that.
|
||||
locales: Vec<String>,
|
||||
|
||||
/// ???
|
||||
#[serde(default = "none")]
|
||||
client_hash: Option<String>,
|
||||
|
||||
/// ???
|
||||
#[serde(default = "none")]
|
||||
gameplay_data_hash: Option<String>,
|
||||
|
||||
/// ???
|
||||
#[serde(default = "none")]
|
||||
timestamp: Option<String>,
|
||||
|
||||
/// ???
|
||||
#[serde(default = "none")]
|
||||
patchline_ref: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
/// Generate a [Option::None] to use as default in [serde].
|
||||
fn none<T>() -> Option<T> {
|
||||
Option::<T>::None
|
||||
}
|
5
src/schema/anybundle/mod.rs
Normal file
5
src/schema/anybundle/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
//! This module defines the types used in all Data Dragon bundles.
|
||||
|
||||
mod metadata;
|
||||
|
||||
pub use metadata::BundleMetadata;
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
pub mod corebundle;
|
||||
pub mod setbundle;
|
||||
pub mod anybundle;
|
||||
|
|
Loading…
Reference in a new issue