summaryrefslogtreecommitdiffstats
path: root/src/launcher/jre/manifest.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-22 02:08:31 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-22 02:10:20 -0600
commite88c17a44c94f788e945c5728bc18beca7e0f8a6 (patch)
tree586873a545cb6bc799129219d5e809106daa58c1 /src/launcher/jre/manifest.rs
parentsupport jre specified in profile (diff)
get started on downloading JREs
also refactor ensure file logic
Diffstat (limited to 'src/launcher/jre/manifest.rs')
-rw-r--r--src/launcher/jre/manifest.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/launcher/jre/manifest.rs b/src/launcher/jre/manifest.rs
new file mode 100644
index 0000000..9b84377
--- /dev/null
+++ b/src/launcher/jre/manifest.rs
@@ -0,0 +1,49 @@
+use std::collections::HashMap;
+use serde::Deserialize;
+use crate::version::DownloadInfo;
+
+#[derive(Debug, Deserialize)]
+pub struct Availability {
+ pub group: u32, // unknown meaning
+ pub progress: u32 // unknown meaning
+}
+
+#[derive(Debug, Deserialize)]
+pub struct Version {
+ pub name: String,
+ pub version: String
+}
+
+#[derive(Debug, Deserialize)]
+pub struct JavaRuntimeInfo {
+ // I don't see how half of this information is useful with how the JRE system currently functions -figboot
+ pub availability: Availability,
+ pub manifest: DownloadInfo,
+ pub version: Version
+}
+
+pub type JavaRuntimesManifest = HashMap<String, HashMap<String, Vec<JavaRuntimeInfo>>>;
+
+#[derive(Debug, Deserialize, Clone, Copy, Eq, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub enum FileType {
+ File,
+ Directory,
+ Link
+}
+
+#[derive(Debug, Deserialize)]
+pub struct JavaRuntimeFile {
+ #[serde(rename = "type")]
+ pub file_type: FileType,
+ #[serde(default)]
+ pub executable: bool,
+
+ pub lzma: DownloadInfo,
+ pub raw: DownloadInfo
+}
+
+#[derive(Debug, Deserialize)]
+pub struct JavaRuntimeManifest {
+ pub files: HashMap<String, JavaRuntimeFile>
+}