pub trait DiskioDevice {
type HardwareError;
// Required methods
fn status(&self) -> FlagSet<StatusFlag>;
fn initialize(&mut self) -> Result<(), Error<Self::HardwareError>>;
fn read(
&self,
buf: &mut [u8],
lba: u64,
) -> Result<(), Error<Self::HardwareError>>;
fn write(
&self,
buf: &[u8],
lba: u64,
) -> Result<(), Error<Self::HardwareError>>;
fn ioctl(&self, cmd: IoctlCmd<'_>) -> Result<(), Error<Self::HardwareError>>;
// Provided method
fn reset(&mut self) { ... }
}
Expand description
Represents disk IO device.
Required Associated Types§
Sourcetype HardwareError
type HardwareError
Device error type.
Required Methods§
Sourcefn status(&self) -> FlagSet<StatusFlag>
fn status(&self) -> FlagSet<StatusFlag>
Get status of device.
Sourcefn initialize(&mut self) -> Result<(), Error<Self::HardwareError>>
fn initialize(&mut self) -> Result<(), Error<Self::HardwareError>>
Initialize device.
Sourcefn read(
&self,
buf: &mut [u8],
lba: u64,
) -> Result<(), Error<Self::HardwareError>>
fn read( &self, buf: &mut [u8], lba: u64, ) -> Result<(), Error<Self::HardwareError>>
Read data blocks from device by address.