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>
impl<R: Read + Seek> VssVolume<R>
Sourcepub fn snapshot(&mut self, index: usize) -> Result<Snapshot<'_, R>, VssError>
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
VssError::StoreIndexOutOfRangeifindexis past the last store.VssError::StoreInfoUnavailableif the store has no type-0x03 catalog pointer (so neither the store-header nor the bitmap offset is known).VssError::Ioon an underlying read/seek failure.
Source§impl<R: Read + Seek> VssVolume<R>
impl<R: Read + Seek> VssVolume<R>
Sourcepub fn open(reader: R) -> Result<Self, VssError>
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.
Sourcepub fn has_vss_header(&self) -> bool
pub fn has_vss_header(&self) -> bool
Whether the volume carries a VSS volume header at 0x1E00.
Sourcepub fn stores(&self) -> &[StoreDescriptor]
pub fn stores(&self) -> &[StoreDescriptor]
The enumerated shadow-copy store descriptors.
Sourcepub fn store_count(&self) -> usize
pub fn store_count(&self) -> usize
The number of enumerated shadow-copy stores.
Sourcepub fn catalog_offset(&self) -> u64
pub fn catalog_offset(&self) -> u64
The catalog offset from the volume header (0 when there is no catalog).
Sourcepub fn volume_size(&self) -> u64
pub fn volume_size(&self) -> u64
The total size of the underlying volume, in bytes.
Sourcepub fn store_info(&mut self, index: usize) -> Result<StoreInfo, VssError>
pub fn store_info(&mut self, index: usize) -> Result<StoreInfo, VssError>
Read and decode the store information for store index.
§Errors
VssError::StoreIndexOutOfRangeifindexis past the last store.VssError::StoreInfoUnavailableif the store has no type-0x03 catalog pointer.VssError::StoreOffsetOutOfBoundsif the store-header offset runs past the end of the volume.VssError::Ioon an underlying read/seek failure.