1
Fork 0
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:
Steffo 2022-08-06 01:55:59 +02:00
parent 199888dc25
commit 30d605ab5a
Signed by: steffo
GPG key ID: 6965406171929D01
3 changed files with 38 additions and 0 deletions

View 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
}

View file

@ -0,0 +1,5 @@
//! This module defines the types used in all Data Dragon bundles.
mod metadata;
pub use metadata::BundleMetadata;

View file

@ -2,3 +2,4 @@
pub mod corebundle;
pub mod setbundle;
pub mod anybundle;