pub struct Archive { /* private fields */ }
Expand description
An archive holding backup material.
Implementations§
source§impl Archive
impl Archive
sourcepub fn create<P: AsRef<Path>>(path: P) -> Result<Archive>
pub fn create<P: AsRef<Path>>(path: P) -> Result<Archive>
Make a new directory to hold an archive, and write the header.
sourcepub fn open<P: AsRef<Path>>(path: P, report: &Report) -> Result<Archive>
pub fn open<P: AsRef<Path>>(path: P, report: &Report) -> Result<Archive>
Open an existing archive.
Checks that the header is correct.
pub fn block_dir(&self) -> &BlockDir
sourcepub fn list_bands(&self) -> Result<Vec<BandId>>
pub fn list_bands(&self) -> Result<Vec<BandId>>
Returns a vector of band ids, in sorted order from first to last.
sourcepub fn last_band_id(&self) -> Result<BandId>
pub fn last_band_id(&self) -> Result<BandId>
Return the BandId
of the highest-numbered band, or ArchiveEmpty,
or an Err if any occurred reading the directory.
sourcepub fn last_complete_band(&self) -> Result<Band>
pub fn last_complete_band(&self) -> Result<Band>
Return the last completely-written band id.
sourcepub fn referenced_blocks(&self) -> Result<BTreeSet<String>>
pub fn referenced_blocks(&self) -> Result<BTreeSet<String>>
Return a sorted set containing all the blocks referenced by all bands.