Skip to main content

VssVolume

Struct VssVolume 

Source
pub struct VssVolume<R> { /* private fields */ }
Expand description

A read-only view over the Volume Shadow Copy metadata of an NTFS volume.

Construct with VssVolume::open over a Read + Seek positioned at the start of the NTFS volume. The catalog of stores is read eagerly (it is small); each store’s StoreInfo is read lazily via VssVolume::store_info.

Implementations§

Source§

impl<R: Read + Seek> VssVolume<R>

Source

pub fn snapshot(&mut self, index: usize) -> Result<Snapshot<'_, R>, VssError>

Build a reconstructed Snapshot of store index.

Walks the store’s block-descriptor list and bitmap eagerly (both are small relative to the volume), then borrows the reader so Snapshot::read_block / Snapshot::read_at can materialize blocks.

§Errors
Source§

impl<R: Read + Seek> VssVolume<R>

Source

pub fn open(reader: R) -> Result<Self, VssError>

Open a VSS view over a positioned NTFS volume reader.

Reads the volume header at 0x1E00; if it carries the VSS identifier and names a catalog, walks the catalog and enumerates the stores. A volume with no VSS header (the header region is zeroed) opens successfully with VssVolume::has_vss_header == false and zero stores.

§Errors

Returns VssError::Io on an underlying read/seek failure.

Source

pub fn has_vss_header(&self) -> bool

Whether the volume carries a VSS volume header at 0x1E00.

Source

pub fn stores(&self) -> &[StoreDescriptor]

The enumerated shadow-copy store descriptors.

Source

pub fn store_count(&self) -> usize

The number of enumerated shadow-copy stores.

Source

pub fn catalog_offset(&self) -> u64

The catalog offset from the volume header (0 when there is no catalog).

Source

pub fn volume_size(&self) -> u64

The total size of the underlying volume, in bytes.

Source

pub fn store_info(&mut self, index: usize) -> Result<StoreInfo, VssError>

Read and decode the store information for store index.

§Errors

Trait Implementations§

Source§

impl<R: Debug> Debug for VssVolume<R>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for VssVolume<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for VssVolume<R>
where R: RefUnwindSafe,

§

impl<R> Send for VssVolume<R>
where R: Send,

§

impl<R> Sync for VssVolume<R>
where R: Sync,

§

impl<R> Unpin for VssVolume<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for VssVolume<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for VssVolume<R>
where R: UnwindSafe,

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, 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.

Source§

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

Source§

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>,

Source§

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.