Trait avrox_storage::RandomRead

source ·
pub trait RandomRead {
    // Required method
    fn read_at_hinted(
        &self,
        addr: SAddr,
        buf: &mut [u8],
        hint: AccessHint
    ) -> Result<usize>;

    // Provided methods
    fn read_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<usize> { ... }
    fn read_full_at_hinted(
        &self,
        addr: SAddr,
        buf: &mut [u8],
        hint: AccessHint
    ) -> Result<()> { ... }
    fn read_full_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<()> { ... }
}
Expand description

Trait implemented by drivers that allow random-access read.

Required Methods§

source

fn read_at_hinted( &self, addr: SAddr, buf: &mut [u8], hint: AccessHint ) -> Result<usize>

Read into the given buffer, from the given device address.

If succesful, the number of bytes actually read will be returned in the Ok() result.

Provided Methods§

source

fn read_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<usize>

Read into the given buffer, from the given device address.

If succesful, the number of bytes actually read will be returned in the Ok() result.

source

fn read_full_at_hinted( &self, addr: SAddr, buf: &mut [u8], hint: AccessHint ) -> Result<()>

Read into the given buffer, from the given device address. The entire buffer will be filled unless an error condition occurs (e.g. attempting to read off the end of device memory). If an error does occur, the state (partially written, not written at all) of the buffer is undefined.

source

fn read_full_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<()>

Read into the given buffer, from the given device address. The entire buffer will be filled unless an error condition occurs (e.g. attempting to read off the end of device memory). If an error does occur, the state (partially written, not written at all) of the buffer is undefined.

Implementors§

source§

impl<const ELEMENTS: usize, const I2C_MASK: u8, const I2C_SHIFT: u8, BC, ELEMENT> RandomRead for CompositeSerProm<ELEMENTS, I2C_MASK, I2C_SHIFT, BC, ELEMENT>
where BC: SerialBusClient, ELEMENT: UsesSerialBusClient<BC> + RandomRead + Storage,

source§

impl<const PAGE_SIZE: usize, SD> RandomRead for PageBuffer<PAGE_SIZE, SD>
where SD: RandomRead + RandomWrite,

source§

impl<const PROM_SIZE: u32, const PAGESIZE: u16, BC> RandomRead for SerPromD8A16be<PROM_SIZE, PAGESIZE, BC>
where BC: SerialBusClient,