pub struct RepetitionLevelDecoderImpl {
decoder: Option<LevelDecoder>,
bit_width: u8,
buffer: Box<[i16; 1024]>,
buffer_len: usize,
buffer_offset: usize,
has_partial: bool,
}
Expand description
An implementation of RepetitionLevelDecoder
for [i16]
Fields§
§decoder: Option<LevelDecoder>
§bit_width: u8
§buffer: Box<[i16; 1024]>
§buffer_len: usize
§buffer_offset: usize
§has_partial: bool
Implementations§
Source§impl RepetitionLevelDecoderImpl
impl RepetitionLevelDecoderImpl
pub fn new(max_level: i16) -> Self
fn fill_buf(&mut self) -> Result<()>
Sourcefn count_records(
&mut self,
records_to_read: usize,
num_levels: usize,
) -> (bool, usize, usize)
fn count_records( &mut self, records_to_read: usize, num_levels: usize, ) -> (bool, usize, usize)
Inspects the buffered repetition levels in the range self.buffer_offset..self.buffer_len
and returns the number of “complete” records along with the corresponding number of values
A “complete” record is one where the buffer contains a subsequent repetition level of 0
Trait Implementations§
Source§impl RepetitionLevelDecoder for RepetitionLevelDecoderImpl
impl RepetitionLevelDecoder for RepetitionLevelDecoderImpl
Source§fn read_rep_levels(
&mut self,
out: &mut Self::Buffer,
num_records: usize,
num_levels: usize,
) -> Result<(usize, usize)>
fn read_rep_levels( &mut self, out: &mut Self::Buffer, num_records: usize, num_levels: usize, ) -> Result<(usize, usize)>
Read up to
max_records
of repetition level data into out
returning the number
of complete records and levels read Read moreSource§fn skip_rep_levels(
&mut self,
num_records: usize,
num_levels: usize,
) -> Result<(usize, usize)>
fn skip_rep_levels( &mut self, num_records: usize, num_levels: usize, ) -> Result<(usize, usize)>
Skips over up to
num_levels
repetition levels corresponding to num_records
records,
where a record is delimited by a repetition level of 0 Read moreSource§fn flush_partial(&mut self) -> bool
fn flush_partial(&mut self) -> bool
Flush any partially read or skipped record
Auto Trait Implementations§
impl !Freeze for RepetitionLevelDecoderImpl
impl RefUnwindSafe for RepetitionLevelDecoderImpl
impl Send for RepetitionLevelDecoderImpl
impl Sync for RepetitionLevelDecoderImpl
impl Unpin for RepetitionLevelDecoderImpl
impl UnwindSafe for RepetitionLevelDecoderImpl
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