pub struct CompressionInfo { /* private fields */ }Implementations§
Source§impl CompressionInfo
impl CompressionInfo
pub fn new( chunk_size: u64, compressed_size: u64, offsets: &[u64], compression_algorithm: CompressionAlgorithm, ) -> Result<Self, ChunkedArchiveError>
Sourcepub fn chunk_size(&self) -> u64
pub fn chunk_size(&self) -> u64
Returns the chunk size for this compressed blob.
Sourcepub fn compressed_size(&self) -> u64
pub fn compressed_size(&self) -> u64
Returns the total compressed size of this blob.
Sourcepub fn compressed_range_for_uncompressed_range(
&self,
range: &Range<u64>,
) -> Result<Range<u64>, ChunkedArchiveError>
pub fn compressed_range_for_uncompressed_range( &self, range: &Range<u64>, ) -> Result<Range<u64>, ChunkedArchiveError>
Returns the compressed range for the specified uncompressed range.
Sourcepub fn decompress(
&self,
src: &[u8],
dst: &mut [u8],
dst_start_offset: u64,
) -> Result<(), ChunkedArchiveError>
pub fn decompress( &self, src: &[u8], dst: &mut [u8], dst_start_offset: u64, ) -> Result<(), ChunkedArchiveError>
Decompress the bytes of src into dst.
srcis allowed to span multiple chunks.dstmust have the exact size of the uncompressed bytes.dst_start_offsetis the location of the uncompressed bytes within the blob and must be chunk aligned. This is necessary for determining the chunk boundaries insrc.
Sourcepub fn streaming_decompressor<'a, B: DataBuffer>(
&'a self,
range: Range<u64>,
uncompressed_size: u64,
dest_buf: B,
) -> Result<(StreamingDecompressor<'a, B>, Range<u64>), ChunkedArchiveError>
pub fn streaming_decompressor<'a, B: DataBuffer>( &'a self, range: Range<u64>, uncompressed_size: u64, dest_buf: B, ) -> Result<(StreamingDecompressor<'a, B>, Range<u64>), ChunkedArchiveError>
Returns a streaming decompressor and the block-aligned compressed range (Range<u64>)
that must be read from storage to decode range into dest_buf.
range.start must be chunk aligned (a multiple of chunk_size).
Trait Implementations§
Source§impl Clone for CompressionInfo
impl Clone for CompressionInfo
Source§fn clone(&self) -> CompressionInfo
fn clone(&self) -> CompressionInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompressionInfo
impl RefUnwindSafe for CompressionInfo
impl Send for CompressionInfo
impl Sync for CompressionInfo
impl Unpin for CompressionInfo
impl UnsafeUnpin for CompressionInfo
impl UnwindSafe for CompressionInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more