pak_db/
meta.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{error::PakResult};
4
5/// The metadata for a Pak file. Each pak file has this data embedded within the header.
6#[derive(Serialize, Deserialize)]
7pub struct PakMeta {
8    pub name: String,
9    pub version: String,
10    pub description: String,
11    pub author: String,
12    pub(crate) extra : Vec<u8>
13}
14
15impl PakMeta {
16    pub fn get_extra<T>(&self) -> PakResult<T> where T : for<'de> Deserialize<'de> {
17        Ok(bincode::deserialize(&self.extra)?)
18    }
19}
20
21/// This carries the size information of each part of the Pak file. this is always the first 32 bytes of the file.
22#[derive(Serialize, Deserialize, Debug)]
23pub struct PakSizing {
24    pub meta_size: u64,
25    pub indices_size: u64,
26    pub vault_size: u64,
27    pub list_size: u64,
28}