Trait device_driver::BufferDevice

source ·
pub trait BufferDevice {
    // Required methods
    fn write(&mut self, id: u32, buf: &[u8]) -> Result<usize, ErrorKind>;
    fn read(&mut self, id: u32, buf: &mut [u8]) -> Result<usize, ErrorKind>;
}
Expand description

A trait to represent the interface to the device.

This is called to read from and write to buffers.

Required Methods§

source

fn write(&mut self, id: u32, buf: &[u8]) -> Result<usize, ErrorKind>

Write to the buffer with the given id.

This interface should adhere to embedded_io::Write::write.

source

fn read(&mut self, id: u32, buf: &mut [u8]) -> Result<usize, ErrorKind>

Read from the buffer with the given id.

This interface should adhere to embedded_io::Read::read.

Implementors§