pub struct ChunkedArchive { /* private fields */ }
Expand description
In-memory representation of a compressed chunked archive.
Implementations§
Source§impl ChunkedArchive
impl ChunkedArchive
Sourcepub fn new(
data: &[u8],
chunk_alignment: usize,
) -> Result<Self, ChunkedArchiveError>
pub fn new( data: &[u8], chunk_alignment: usize, ) -> Result<Self, ChunkedArchiveError>
Create a ChunkedArchive for data
compressing each chunk in parallel. This function uses
the rayon
crate for parallelism. By default compression happens in the global thread pool,
but this function can also be executed within a locally scoped pool.
Sourcepub fn chunks(&self) -> &Vec<CompressedChunk>
pub fn chunks(&self) -> &Vec<CompressedChunk>
Accessor for compressed chunk data.
Sourcepub fn chunk_size(&self) -> usize
pub fn chunk_size(&self) -> usize
The chunk size calculated for this archive during compression. Represents how input data was chunked for compression. Note that the final chunk may be smaller than this amount when decompressed.
Sourcepub fn compressed_data_size(&self) -> usize
pub fn compressed_data_size(&self) -> usize
Sum of sizes of all compressed chunks.
Sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
Total size of the archive in bytes.
Auto Trait Implementations§
impl Freeze for ChunkedArchive
impl RefUnwindSafe for ChunkedArchive
impl Send for ChunkedArchive
impl Sync for ChunkedArchive
impl Unpin for ChunkedArchive
impl UnwindSafe for ChunkedArchive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more