Struct conserve::archive::Archive

source ·
pub struct Archive { /* private fields */ }
Expand description

An archive holding backup material.

Implementations§

source§

impl Archive

source

pub fn create_path(path: &Path) -> Result<Archive>

Make a new archive in a local directory.

source

pub fn create(transport: Arc<dyn Transport>) -> Result<Archive>

Make a new archive in a new directory accessed by a Transport.

source

pub fn open_path(path: &Path) -> Result<Archive>

Open an existing archive.

Checks that the header is correct.

source

pub fn open(transport: Arc<dyn Transport>) -> Result<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 Clone for Archive

source§

fn clone(&self) -> Archive

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Archive

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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