mirror of
https://github.com/Drop-OSS/droplet.git
synced 2025-11-17 02:01:19 +10:00
initial commit
This commit is contained in:
25
src/manifest.rs
Normal file
25
src/manifest.rs
Normal file
@ -0,0 +1,25 @@
|
||||
use std::{collections::HashMap, fs::File, path::Path};
|
||||
|
||||
use ciborium::into_writer;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct ManifestChunk {
|
||||
pub uuid: String,
|
||||
pub index: i64,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct ManifestRecord {
|
||||
pub chunks: Vec<ManifestChunk>,
|
||||
pub permissions: u32,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Manifest {
|
||||
pub record: HashMap<String, ManifestRecord>,
|
||||
}
|
||||
|
||||
pub fn generate_manifest(manifest: Manifest, path: &Path) {
|
||||
let file = File::create(path).unwrap();
|
||||
into_writer(&manifest, file).unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user