pub struct PassthroughEncoding;Expand description
No-op encoding: wire bytes ARE payload bytes. Used by media that do not byte-stuff (SMBus/eSPI, test fixtures).
Trait Implementations§
Source§impl BufferEncoding for PassthroughEncoding
impl BufferEncoding for PassthroughEncoding
Source§fn write_byte(wire_buf: &mut [u8], byte: u8) -> Result<usize, EncodeError>
fn write_byte(wire_buf: &mut [u8], byte: u8) -> Result<usize, EncodeError>
Encode one logical payload byte into
wire_buf starting at
index 0. Returns the number of wire bytes written (1 for plain,
2 for an escape sequence). The caller advances their write
cursor by the returned count.Source§fn read_byte(wire_buf: &[u8]) -> Result<(u8, usize), DecodeError>
fn read_byte(wire_buf: &[u8]) -> Result<(u8, usize), DecodeError>
Decode the next logical payload byte from
wire_buf starting at
index 0. Returns (decoded_byte, wire_bytes_consumed). The
caller advances their read cursor by wire_bytes_consumed.Source§fn wire_size_of(decoded: &[u8]) -> usize
fn wire_size_of(decoded: &[u8]) -> usize
Wire-byte footprint of
decoded under this encoding. Must equal
the sum of write_byte(_, b) lengths for each b in decoded.
NO default impl: every encoding declares its sizing rule
explicitly.Source§impl Clone for PassthroughEncoding
impl Clone for PassthroughEncoding
Source§fn clone(&self) -> PassthroughEncoding
fn clone(&self) -> PassthroughEncoding
Returns a duplicate 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 PassthroughEncoding
impl Debug for PassthroughEncoding
Source§impl Format for PassthroughEncoding
impl Format for PassthroughEncoding
Source§impl PartialEq for PassthroughEncoding
impl PartialEq for PassthroughEncoding
impl Copy for PassthroughEncoding
impl Eq for PassthroughEncoding
impl StructuralPartialEq for PassthroughEncoding
Auto Trait Implementations§
impl Freeze for PassthroughEncoding
impl RefUnwindSafe for PassthroughEncoding
impl Send for PassthroughEncoding
impl Sync for PassthroughEncoding
impl Unpin for PassthroughEncoding
impl UnsafeUnpin for PassthroughEncoding
impl UnwindSafe for PassthroughEncoding
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