Struct conserve::test_fixtures::ScratchArchive
source · pub struct ScratchArchive { /* private fields */ }
Expand description
A temporary archive, deleted when it goes out of scope.
The ScratchArchive can be treated as an Archive.
Implementations§
source§impl ScratchArchive
impl ScratchArchive
pub fn new() -> ScratchArchive
pub fn path(&self) -> &Path
pub fn setup_incomplete_empty_band(&self)
pub fn store_two_versions(&self)
pub fn transport(&self) -> &dyn Transport
Methods from Deref<Target = Archive>§
pub fn block_dir(&self) -> &BlockDir
pub fn band_exists(&self, band_id: BandId) -> Result<bool>
pub fn band_is_closed(&self, band_id: BandId) -> Result<bool>
sourcepub fn iter_entries(
&self,
band_selection: BandSelectionPolicy,
subtree: Apath,
exclude: Exclude
) -> Result<impl Iterator<Item = IndexEntry>>
pub fn iter_entries( &self, band_selection: BandSelectionPolicy, subtree: Apath, exclude: Exclude ) -> Result<impl Iterator<Item = IndexEntry>>
Return an iterator of entries in a selected version.
sourcepub fn list_band_ids(&self) -> Result<Vec<BandId>>
pub fn list_band_ids(&self) -> Result<Vec<BandId>>
Returns a vector of band ids, in sorted order from first to last.
pub fn resolve_band_id( &self, band_selection: BandSelectionPolicy ) -> Result<BandId>
pub fn open_stored_tree( &self, band_selection: BandSelectionPolicy ) -> Result<StoredTree>
sourcepub fn last_band_id(&self) -> Result<Option<BandId>>
pub fn last_band_id(&self) -> Result<Option<BandId>>
Return the BandId
of the highest-numbered band, or Ok(None) if there
are no bands, or an Err if any occurred reading the directory.
sourcepub fn last_complete_band(&self) -> Result<Option<Band>>
pub fn last_complete_band(&self) -> Result<Option<Band>>
Return the last completely-written band id, if any.
sourcepub fn referenced_blocks(
&self,
band_ids: &[BandId],
monitor: Arc<dyn Monitor>
) -> Result<HashSet<BlockHash>>
pub fn referenced_blocks( &self, band_ids: &[BandId], monitor: Arc<dyn Monitor> ) -> Result<HashSet<BlockHash>>
Returns all blocks referenced by all bands.
Shows a progress bar as they’re collected.
sourcepub fn unreferenced_blocks(
&self,
monitor: Arc<dyn Monitor>
) -> Result<impl ParallelIterator<Item = BlockHash>>
pub fn unreferenced_blocks( &self, monitor: Arc<dyn Monitor> ) -> Result<impl ParallelIterator<Item = BlockHash>>
Returns an iterator of blocks that are present and referenced by no index.
sourcepub fn delete_bands(
&self,
delete_band_ids: &[BandId],
options: &DeleteOptions,
monitor: Arc<dyn Monitor>
) -> Result<DeleteStats>
pub fn delete_bands( &self, delete_band_ids: &[BandId], options: &DeleteOptions, monitor: Arc<dyn Monitor> ) -> Result<DeleteStats>
Delete bands, and the blocks that they reference.
If delete_band_ids
is empty, this deletes no bands, but will delete any garbage
blocks referenced by no existing bands.
Trait Implementations§
source§impl AsRef<Archive> for ScratchArchive
impl AsRef<Archive> for ScratchArchive
source§impl Default for ScratchArchive
impl Default for ScratchArchive
Auto Trait Implementations§
impl !RefUnwindSafe for ScratchArchive
impl Send for ScratchArchive
impl Sync for ScratchArchive
impl Unpin for ScratchArchive
impl !UnwindSafe for ScratchArchive
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more