Struct cobs::EncoderState
source · pub struct EncoderState { /* private fields */ }
Expand description
The EncoderState
is used to track the current state of a
streaming encoder. This struct does not contain the output buffer
(or a reference to one), and can be used when streaming the encoded
output to a custom data type
IMPORTANT NOTE: When implementing a custom streaming encoder,
the EncoderState
state machine assumes that the output buffer
ALREADY contains a single placeholder byte, and no other bytes.
This placeholder byte will be later modified with the first distance
to the next header/zero byte.
Implementations§
source§impl EncoderState
impl EncoderState
sourcepub fn push(&mut self, data: u8) -> PushResult
pub fn push(&mut self, data: u8) -> PushResult
Push a single unencoded byte into the encoder state machine
Trait Implementations§
source§impl Clone for EncoderState
impl Clone for EncoderState
source§fn clone(&self) -> EncoderState
fn clone(&self) -> EncoderState
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 EncoderState
impl Debug for EncoderState
Auto Trait Implementations§
impl Freeze for EncoderState
impl RefUnwindSafe for EncoderState
impl Send for EncoderState
impl Sync for EncoderState
impl Unpin for EncoderState
impl UnwindSafe for EncoderState
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
)