struct PackedDecoder {
data: Bytes,
data_offset: usize,
rle_left: usize,
rle_value: bool,
packed_count: usize,
packed_offset: usize,
}Expand description
An optimized decoder for decoding RLE and BIT_PACKED data with a bit width of 1 directly into a bitmask
This is significantly faster than decoding the data into [i16] and then computing
a bitmask from this, as not only can it skip this buffer allocation and construction,
but it can exploit properties of the encoded data to reduce work further
In particular:
- Packed runs are already bitmask encoded and can simply be appended
- Runs of 1 or 0 bits can be efficiently appended with byte (or larger) operations
Fields§
§data: Bytes§data_offset: usize§rle_left: usize§rle_value: bool§packed_count: usize§packed_offset: usizeImplementations§
Source§impl PackedDecoder
impl PackedDecoder
fn next_rle_block(&mut self) -> Result<()>
Sourcefn decode_header(&mut self) -> Result<i64>
fn decode_header(&mut self) -> Result<i64>
Decodes a VLQ encoded little endian integer and returns it
Auto Trait Implementations§
impl !Freeze for PackedDecoder
impl RefUnwindSafe for PackedDecoder
impl Send for PackedDecoder
impl Sync for PackedDecoder
impl Unpin for PackedDecoder
impl UnwindSafe for PackedDecoder
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> 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