pub enum Operation16 {
Literal(u8),
Repeat(u16, u16),
}Expand description
Describes an unpacking operation, that can be fed additional data to recieved an output byte and the next operation
Variants§
Literal(u8)
We’re in the middle of returning literal bytes
Repeat(u16, u16)
The unpacker will emit .1 more repetitions of byte .0
Implementations§
Source§impl Operation16
impl Operation16
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty operation, advancing (Operation::advance) it will read an entire new operation from the
underlying reader.
Sourcepub fn advance<T: Read>(
&self,
reader: &mut T,
) -> Result<(u16, Self), OperationError>
pub fn advance<T: Read>( &self, reader: &mut T, ) -> Result<(u16, Self), OperationError>
Produce a byte and return next state of the decoder at the same time
If self was already completed, this function will try to fetch the next command from the underlying
reader. Otherwise it will just perform the repetition, or read the next literal.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Determines if the current operation has been advanced to completion.
Trait Implementations§
Source§impl Debug for Operation16
impl Debug for Operation16
Auto Trait Implementations§
impl Freeze for Operation16
impl RefUnwindSafe for Operation16
impl Send for Operation16
impl Sync for Operation16
impl Unpin for Operation16
impl UnsafeUnpin for Operation16
impl UnwindSafe for Operation16
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