dump meta

This commit is contained in:
Marin Postma 2021-05-27 10:51:19 +02:00
parent b924e897f1
commit c47369839b
No known key found for this signature in database
GPG key ID: D5241F0C0C865F30
3 changed files with 82 additions and 54 deletions

View file

@ -62,6 +62,10 @@ pub enum Metadata {
}
impl Metadata {
pub fn new_v2(index_db_size: u64, update_db_size: u64) -> Self {
let meta = MetadataV2::new(index_db_size, update_db_size);
Self::V2 { meta }
}
/// Extract Metadata from `metadata.json` file present at provided `dir_path`
fn from_path(dir_path: &Path) -> anyhow::Result<Self> {
let path = dir_path.join("metadata.json");