Enum q_compress::ChunkBodyDecompressor
source · [−]pub enum ChunkBodyDecompressor<T: NumberLike> {
// some variants omitted
}
Expand description
A low-level, stateful way to decompress small batches of numbers at a time.
After decompressing metadata with a Decompressor
, you may call
Decompressor::get_chunk_body_decompressor
to create an instance of ChunkBodyDecompressor
.
Implementations
sourceimpl<T: NumberLike> ChunkBodyDecompressor<T>
impl<T: NumberLike> ChunkBodyDecompressor<T>
sourcepub fn decompress_next_batch(
&mut self,
reader: &mut BitReader<'_>,
limit: usize
) -> QCompressResult<Vec<T>>
pub fn decompress_next_batch(
&mut self,
reader: &mut BitReader<'_>,
limit: usize
) -> QCompressResult<Vec<T>>
Returns up to limit
numbers from the BitReader
.
Will return an error if the reader runs out of data.
This maintains an internal state allowing you to pick up where you left off. For example, calling on a chunk containing 11 numbers using limit 5 repeatedly will return
- the first 5 numbers in the first batch,
- then the next 5,
- then the last number,
- then an empty vector for each following call.
Auto Trait Implementations
impl<T> RefUnwindSafe for ChunkBodyDecompressor<T> where
T: RefUnwindSafe,
<T as NumberLike>::Signed: RefUnwindSafe,
<T as NumberLike>::Unsigned: RefUnwindSafe,
impl<T> Send for ChunkBodyDecompressor<T> where
T: Send,
<T as NumberLike>::Signed: Send,
<T as NumberLike>::Unsigned: Send,
impl<T> Sync for ChunkBodyDecompressor<T> where
T: Sync,
<T as NumberLike>::Signed: Sync,
<T as NumberLike>::Unsigned: Sync,
impl<T> Unpin for ChunkBodyDecompressor<T> where
T: Unpin,
<T as NumberLike>::Signed: Unpin,
<T as NumberLike>::Unsigned: Unpin,
impl<T> UnwindSafe for ChunkBodyDecompressor<T> where
T: UnwindSafe,
<T as NumberLike>::Signed: UnwindSafe,
<T as NumberLike>::Unsigned: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more