pub enum ControlWordParser {
BOTH8(u8, u32),
BOTH16(u8, u32),
BOTH32(u8, u32),
REP8,
REP16,
REP32,
DEF8,
DEF16,
DEF32,
NIL,
}
Expand description
A parser to unwrap control words into repetition and definition levels
This is the inverse of the ControlWordIterator
.
Variants§
Implementations§
Source§impl ControlWordParser
impl ControlWordParser
Sourcepub fn bytes_per_word(&self) -> usize
pub fn bytes_per_word(&self) -> usize
Returns the number of bytes per control word
Sourcepub fn parse(&self, src: &[u8], dst_rep: &mut Vec<u16>, dst_def: &mut Vec<u16>)
pub fn parse(&self, src: &[u8], dst_rep: &mut Vec<u16>, dst_def: &mut Vec<u16>)
Appends the next control word to the rep & def buffers
src
should be pointing at the first byte (little endian) of the control word
dst_rep
and dst_def
are the buffers to append the rep and def levels to.
They will not be appended to if not needed.
Trait Implementations§
Source§impl Clone for ControlWordParser
impl Clone for ControlWordParser
Source§fn clone(&self) -> ControlWordParser
fn clone(&self) -> ControlWordParser
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ControlWordParser
impl Debug for ControlWordParser
impl Copy for ControlWordParser
Auto Trait Implementations§
impl Freeze for ControlWordParser
impl RefUnwindSafe for ControlWordParser
impl Send for ControlWordParser
impl Sync for ControlWordParser
impl Unpin for ControlWordParser
impl UnwindSafe for ControlWordParser
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§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