Struct uefi::proto::media::block::BlockIO [−][src]
#[repr(C)]pub struct BlockIO { /* fields omitted */ }
The Block I/O protocol.
Implementations
impl BlockIO
[src]
impl BlockIO
[src]pub fn media(&self) -> &BlockIOMedia
[src]
pub fn media(&self) -> &BlockIOMedia
[src]Pointer for block IO media.
pub fn read_blocks(&self, media_id: u32, lba: Lba, buffer: &mut [u8]) -> Result
[src]
pub fn read_blocks(&self, media_id: u32, lba: Lba, buffer: &mut [u8]) -> Result
[src]Read the requested number of blocks from the device.
Arguments
media_id
- The media ID that the read request is for.lba
- The starting logical block address to read from on the device.buffer
- The target buffer of the read operation
Errors
uefi::Status::DEVICE_ERROR
The device reported an error while attempting to perform the read operation.uefi::Status::NO_MEDIA
There is no media in the device.uefi::Status::MEDIA_CHANGED
Themedia_id
is not for the current media.uefi::Status::BAD_BUFFER_SIZE
The buffer size parameter is not a multiple of the intrinsic block size of the device.uefi::Status::INVALID_PARAMETER
The read request contains LBAs that are not valid, or the buffer is not on proper alignment.
pub fn write_blocks(&mut self, media_id: u32, lba: Lba, buffer: &[u8]) -> Result
[src]
pub fn write_blocks(&mut self, media_id: u32, lba: Lba, buffer: &[u8]) -> Result
[src]Writes the requested number of blocks to the device.
Arguments
media_id
The media ID that the write request is for.lba
The starting logical block address to be written.buffer
Buffer to be written
Errors
uefi::Status::WRITE_PROTECTED
The device cannot be written to.uefi::Status::NO_MEDIA
There is no media in the device.uefi::Status::MEDIA_CHANGED
Themedia_id
is not for the current media.uefi::Status::DEVICE_ERROR
The device reported an error while attempting to perform the write operation.uefi::Status::BAD_BUFFER_SIZE
The buffer size parameter is not a multiple of the intrinsic block size of the device.uefi::Status::INVALID_PARAMETER
The write request contains LBAs that are not valid, or the buffer is not on proper alignment.
pub fn flush_blocks(&mut self) -> Result
[src]
pub fn flush_blocks(&mut self) -> Result
[src]Flushes all modified data to a physical block device.
Errors
uefi::Status::DEVICE_ERROR
The device reported an error while attempting to write data.uefi::Status::NO_MEDIA
There is no media in the device.