ReadBuffer

Trait ReadBuffer 

Source
pub trait ReadBuffer {
    // Required method
    fn read_n<const N: usize>(&mut self) -> Result<[u8; N], UcPackError>;

    // Provided method
    fn read_u8(&mut self) -> Result<u8, UcPackError> { ... }
}
Expand description

A readable buffer. Implemented by cursor types.

You have to provide a method to copy-read N bytes from the buffer.

Required Methods§

Source

fn read_n<const N: usize>(&mut self) -> Result<[u8; N], UcPackError>

Provided Methods§

Source

fn read_u8(&mut self) -> Result<u8, UcPackError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: ReadBuffer> ReadBuffer for &mut T

Source§

fn read_u8(&mut self) -> Result<u8, UcPackError>

Source§

fn read_n<const N: usize>(&mut self) -> Result<[u8; N], UcPackError>

Implementors§