pub enum ControlWordIterator {
Binary8(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u8>),
Binary16(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u16>),
Binary32(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u32>),
Unary8(UnaryControlWordIterator<IntoIter<u16>, u8>),
Unary16(UnaryControlWordIterator<IntoIter<u16>, u16>),
Unary32(UnaryControlWordIterator<IntoIter<u16>, u32>),
Nilary(NilaryControlWordIterator),
}
Expand description
An iterator that generates control words from repetition and definition levels
“Control word” is just a fancy term for a single u8/u16/u32 that contains both the repetition and definition in it.
In the large majority of case we only need a single byte to represent both the repetition and definition levels. However, if there is deep nesting then we may need two bytes. In the worst case we need 4 bytes though this suggests hundreds of levels of nesting which seems unlikely to encounter in practice.
Variants§
Binary8(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u8>)
Binary16(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u16>)
Binary32(BinaryControlWordIterator<Zip<IntoIter<u16>, IntoIter<u16>>, u32>)
Unary8(UnaryControlWordIterator<IntoIter<u16>, u8>)
Unary16(UnaryControlWordIterator<IntoIter<u16>, u16>)
Unary32(UnaryControlWordIterator<IntoIter<u16>, u32>)
Nilary(NilaryControlWordIterator)
Implementations§
Source§impl ControlWordIterator
impl ControlWordIterator
Sourcepub fn append_next(&mut self, buf: &mut Vec<u8>)
pub fn append_next(&mut self, buf: &mut Vec<u8>)
Appends the next control word to the buffer
Sourcepub fn bytes_per_word(&self) -> usize
pub fn bytes_per_word(&self) -> usize
Returns the number of bytes per control word
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ControlWordIterator
impl RefUnwindSafe for ControlWordIterator
impl Send for ControlWordIterator
impl Sync for ControlWordIterator
impl Unpin for ControlWordIterator
impl UnwindSafe for ControlWordIterator
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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