Trait avrox_storage::RandomWrite

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

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

Trait implemented by drivers that allow random-access write.

Required Methods§

source

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

Write the contents of the given buffer at the given device address. Depending on the nature of the underlying device, the write may not complete. The number of bytes actually written will be returned in the Ok() result, and it is the caller’s responsibility to resume writing the remainder.

source

fn flush(&mut self) -> Result<()>

Flush the write to the device. Writes are not guaranteed to have been completed unless this method has been called.

Provided Methods§

source

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

Write the contents of the given buffer at the given device address. THe entire buffer will be written unless an error condition occurs. If an error does occur, the state (partially written, not written at all) is undefined.

source

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

Write the contents of the given buffer at the given device address. THe entire buffer will be written unless an error condition occurs. If an error does occur, the state (partially written, not written at all) is undefined.

source

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

Write the contents of the given buffer at the given device address. Depending on the nature of the underlying device, the write may not complete. The number of bytes actually written will be returned in the Ok() result, and it is the caller’s responsibility to resume writing the remainder.

Implementors§

source§

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

source§

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

source§

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