pub struct Archive<R> { /* private fields */ }
Expand description
A readable archive.
Implementations§
source§impl<R> Archive<R>
impl<R> Archive<R>
sourcepub async fn try_init(reader: R) -> Result<Self, ArchiveError<R::Error>>where
R: ArchiveReader,
pub async fn try_init(reader: R) -> Result<Self, ArchiveError<R::Error>>where
R: ArchiveReader,
Try to initialize an archive from a reader.
sourcepub fn total_chunks(&self) -> usize
pub fn total_chunks(&self) -> usize
Total number of chunks in archive (including duplicates).
sourcepub fn unique_chunks(&self) -> usize
pub fn unique_chunks(&self) -> usize
Total number of unique chunks in archive (no duplicates).
sourcepub fn compressed_size(&self) -> u64
pub fn compressed_size(&self) -> u64
Total size of chunks in archive when compressed.
sourcepub fn chunk_data_offset(&self) -> u64
pub fn chunk_data_offset(&self) -> u64
On which offset in the archive the chunk data starts at.
sourcepub fn chunk_descriptors(&self) -> &[ChunkDescriptor]
pub fn chunk_descriptors(&self) -> &[ChunkDescriptor]
Get archive chunk descriptors.
sourcepub fn total_source_size(&self) -> u64
pub fn total_source_size(&self) -> u64
Total size of the original source file.
sourcepub fn source_checksum(&self) -> &HashSum
pub fn source_checksum(&self) -> &HashSum
Checksum of the original source file (Blake2).
sourcepub fn chunker_config(&self) -> &Config
pub fn chunker_config(&self) -> &Config
Get the chunker configuration used when building the archive.
sourcepub fn header_checksum(&self) -> &HashSum
pub fn header_checksum(&self) -> &HashSum
Get the checksum of the archive header.
sourcepub fn header_size(&self) -> usize
pub fn header_size(&self) -> usize
Get the size of the archive header.
sourcepub fn chunk_hash_length(&self) -> usize
pub fn chunk_hash_length(&self) -> usize
Get the hash length used for identifying chunks when building the archive.
sourcepub fn chunk_compression(&self) -> Option<Compression>
pub fn chunk_compression(&self) -> Option<Compression>
Get the compression used for chunks in the archive.
sourcepub fn built_with_version(&self) -> &str
pub fn built_with_version(&self) -> &str
Get the version of crate used when building the archive.
sourcepub fn iter_source_chunks(
&self
) -> impl Iterator<Item = (u64, &ChunkDescriptor)>
pub fn iter_source_chunks( &self ) -> impl Iterator<Item = (u64, &ChunkDescriptor)>
Iterate chunks as ordered in source.
sourcepub fn build_source_index(&self) -> ChunkIndex
pub fn build_source_index(&self) -> ChunkIndex
Build a ChunkIndex representing the source file.
sourcepub fn chunk_stream<'a>(
&'a mut self,
chunks: &ChunkIndex
) -> impl Stream<Item = Result<CompressedArchiveChunk, R::Error>> + Unpin + Sized + 'awhere
R: ArchiveReader + 'a,
pub fn chunk_stream<'a>(
&'a mut self,
chunks: &ChunkIndex
) -> impl Stream<Item = Result<CompressedArchiveChunk, R::Error>> + Unpin + Sized + 'awhere
R: ArchiveReader + 'a,
Get a stream of chunks from the archive.