Struct uefi::proto::media::block::BlockIO

source ·
pub struct BlockIO(/* private fields */);
Expand description

The Block I/O protocol.

Implementations§

source§

impl BlockIO

source

pub const fn media(&self) -> &BlockIOMedia

Pointer for block IO media.

source

pub fn reset(&mut self, extended_verification: bool) -> Result

Resets the block device hardware.

§Arguments
  • extended_verification Indicates that the driver may perform a more exhaustive verification operation of the device during reset.
§Errors
  • uefi::Status::DEVICE_ERROR The block device is not functioning correctly and could not be reset.
source

pub fn read_blocks(&self, media_id: u32, lba: Lba, buffer: &mut [u8]) -> Result

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 The media_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.
source

pub fn write_blocks(&mut self, media_id: u32, lba: Lba, buffer: &[u8]) -> Result

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 The media_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.
source

pub fn flush_blocks(&mut self) -> Result

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.

Trait Implementations§

source§

impl Debug for BlockIO

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Identify for BlockIO

source§

const GUID: Guid = BlockIoProtocol::GUID

Unique protocol identifier.
source§

impl Protocol for BlockIO

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<P> ProtocolPointer for P
where P: Protocol,

source§

unsafe fn ptr_from_ffi(ptr: *const c_void) -> *const P

Create a const pointer to a Protocol from a c_void pointer. Read more
source§

unsafe fn mut_ptr_from_ffi(ptr: *mut c_void) -> *mut P

Create a mutable pointer to a Protocol from a c_void pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.