pub struct UefiBlockIoAdapter<'a> {
protocol: &'a mut BlockIoProtocol,
block_size: BlockSize,
}Fields§
§protocol: &'a mut BlockIoProtocol§block_size: BlockSizeImplementations§
Source§impl<'a> UefiBlockIoAdapter<'a>
impl<'a> UefiBlockIoAdapter<'a>
pub fn new(protocol: &'a mut BlockIoProtocol) -> Result<Self, AdapterError>
Trait Implementations§
Source§impl BlockIo for UefiBlockIoAdapter<'_>
impl BlockIo for UefiBlockIoAdapter<'_>
Source§type Error = AdapterError
type Error = AdapterError
IO error type.
Source§fn block_size(&self) -> BlockSize
fn block_size(&self) -> BlockSize
Get the [
BlockSize]. The return value is not allowed to
change.Source§fn num_blocks(&mut self) -> Result<u64, Self::Error>
fn num_blocks(&mut self) -> Result<u64, Self::Error>
Get the number of logical blocks in the disk. Read more
Source§fn read_blocks(
&mut self,
start_lba: Lba,
dst: &mut [u8],
) -> Result<(), Self::Error>
fn read_blocks( &mut self, start_lba: Lba, dst: &mut [u8], ) -> Result<(), Self::Error>
Read contiguous blocks from the disk. The
dst buffer size must
be a multiple of block_size. Implementations are permitted
to panic if this precondition is not met, e.g. by calling
[BlockSize::assert_valid_block_buffer].Source§fn write_blocks(
&mut self,
start_lba: Lba,
src: &[u8],
) -> Result<(), Self::Error>
fn write_blocks( &mut self, start_lba: Lba, src: &[u8], ) -> Result<(), Self::Error>
Write contiguous block to the disk. The
src buffer size must
be a multiple of block_size. Implementations are permitted
to panic if this precondition is not met, e.g. by calling
[BlockSize::assert_valid_block_buffer]. Read moreAuto Trait Implementations§
impl<'a> Freeze for UefiBlockIoAdapter<'a>
impl<'a> RefUnwindSafe for UefiBlockIoAdapter<'a>
impl<'a> !Send for UefiBlockIoAdapter<'a>
impl<'a> !Sync for UefiBlockIoAdapter<'a>
impl<'a> Unpin for UefiBlockIoAdapter<'a>
impl<'a> !UnwindSafe for UefiBlockIoAdapter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more