pub struct Disk { /* private fields */ }Expand description
A disk device with a cursor.
Implementations§
Trait Implementations§
Source§impl BlockDevice for Disk
impl BlockDevice for Disk
Source§fn write(
&mut self,
buffer: &[u8],
block_id: AbsoluteBN,
count: u32,
) -> Ext4Result<()>
fn write( &mut self, buffer: &[u8], block_id: AbsoluteBN, count: u32, ) -> Ext4Result<()>
Writes
count blocks from buffer starting at block_id.Source§fn read(
&mut self,
buffer: &mut [u8],
block_id: AbsoluteBN,
count: u32,
) -> Ext4Result<()>
fn read( &mut self, buffer: &mut [u8], block_id: AbsoluteBN, count: u32, ) -> Ext4Result<()>
Reads
count blocks into buffer starting at block_id.Source§fn open(&mut self) -> Ext4Result<()>
fn open(&mut self) -> Ext4Result<()>
Opens the underlying device.
Source§fn close(&mut self) -> Ext4Result<()>
fn close(&mut self) -> Ext4Result<()>
Closes the underlying device.
Source§fn total_blocks(&self) -> u64
fn total_blocks(&self) -> u64
Returns the total number of device blocks.
Source§fn current_time(&self) -> Ext4Result<Ext4Timestamp>
fn current_time(&self) -> Ext4Result<Ext4Timestamp>
Returns the current timestamp used for inode metadata updates.
Source§fn block_size(&self) -> u32
fn block_size(&self) -> u32
Returns the device block size in bytes.
Source§fn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Returns whether the device is read-only.
Source§impl Read for Disk
impl Read for Disk
Source§impl Write for Disk
impl Write for Disk
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Auto Trait Implementations§
impl Freeze for Disk
impl !RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl UnsafeUnpin for Disk
impl !UnwindSafe for Disk
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