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§
Provided Methods§
sourcefn read_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<usize>
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.
sourcefn read_full_at_hinted(
&self,
addr: SAddr,
buf: &mut [u8],
hint: AccessHint
) -> Result<()>
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.
sourcefn read_full_at(&self, addr: SAddr, buf: &mut [u8]) -> Result<()>
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.