summaryrefslogtreecommitdiffstats
path: root/src/filestore/release.rs
blob: c05d7e89fa02ec8452f1b4ec038fe717d177d80a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::fmt::Debug;

use anyhow::Result;
use indicatif::ProgressBar;

use crate::filestore::util::FileStoreImpl;
use crate::filestore::path::StoreRoot;

// The implementation of this type must be available in the merged filestore.
pub struct ReleaseStore(pub (in crate::filestore) FileStoreImpl);

impl Debug for ReleaseStore {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::result::Result<(), std::fmt::Error> {
        write!(f, "StagingStore(root: {})", self.0.root.display())
    }
}


impl ReleaseStore {
    pub fn load(root: StoreRoot, progress: ProgressBar) -> Result<Self> {
        FileStoreImpl::load(root, progress).map(ReleaseStore)
    }
}