pub struct Decoder<'a, T: Unpackable> { /* private fields */ }
Expand description
An Iterator
of Unpackable
unpacked from a bitpacked slice of bytes.
§Implementation
This iterator unpacks bytes in chunks and does not allocate.
Implementations§
Source§impl<'a, T: Unpackable> Decoder<'a, T>
impl<'a, T: Unpackable> Decoder<'a, T>
Sourcepub fn new(packed: &'a [u8], num_bits: usize, length: usize) -> Self
pub fn new(packed: &'a [u8], num_bits: usize, length: usize) -> Self
Returns a Decoder
with T
encoded in packed
with num_bits
.
Sourcepub fn new_allow_zero(packed: &'a [u8], num_bits: usize, length: usize) -> Self
pub fn new_allow_zero(packed: &'a [u8], num_bits: usize, length: usize) -> Self
Returns a Decoder
with T
encoded in packed
with num_bits
.
num_bits
is allowed to be 0
.
Sourcepub fn try_new_allow_zero(
packed: &'a [u8],
num_bits: usize,
length: usize,
) -> ParquetResult<Self>
pub fn try_new_allow_zero( packed: &'a [u8], num_bits: usize, length: usize, ) -> ParquetResult<Self>
Returns a Decoder
with T
encoded in packed
with num_bits
.
num_bits
is allowed to be 0
.
Sourcepub fn try_new(
packed: &'a [u8],
num_bits: usize,
length: usize,
) -> ParquetResult<Self>
pub fn try_new( packed: &'a [u8], num_bits: usize, length: usize, ) -> ParquetResult<Self>
Returns a Decoder
with T
encoded in packed
with num_bits
.
pub fn num_bits(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Decoder<'a, T>
impl<'a, T> RefUnwindSafe for Decoder<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Decoder<'a, T>where
T: Send,
impl<'a, T> Sync for Decoder<'a, T>where
T: Sync,
impl<'a, T> Unpin for Decoder<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Decoder<'a, T>where
T: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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