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