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§

Methods from Deref<Target = Archive>§

source

pub fn block_dir(&self) -> &BlockDir

source

pub fn band_exists(&self, band_id: BandId) -> Result<bool>

source

pub fn band_is_closed(&self, band_id: BandId) -> Result<bool>

source

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.

source

pub fn list_band_ids(&self) -> Result<Vec<BandId>>

Returns a vector of band ids, in sorted order from first to last.

source

pub fn resolve_band_id( &self, band_selection: BandSelectionPolicy ) -> Result<BandId>

source

pub fn open_stored_tree( &self, band_selection: BandSelectionPolicy ) -> Result<StoredTree>

source

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.

source

pub fn last_complete_band(&self) -> Result<Option<Band>>

Return the last completely-written band id, if any.

source

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.

source

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.

source

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.

source

pub fn validate( &self, options: &ValidateOptions, monitor: Arc<dyn Monitor> ) -> Result<()>

Walk the archive to check all invariants.

If problems are found, they are emitted as warn or error level tracing messages. This function only returns an error if validation stops due to a fatal error.

Trait Implementations§

source§

impl AsRef<Archive> for ScratchArchive

source§

fn as_ref(&self) -> &Archive

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Default for ScratchArchive

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for ScratchArchive

source§

fn deref(&self) -> &Archive

ScratchArchive can be directly used as an archive.

§

type Target = Archive

The resulting type after dereferencing.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more