pub struct Partition { /* private fields */ }Expand description
A partition wrapper that provides access to a specific partition of a disk.
Implementations§
Trait Implementations§
Source§impl BlockDevice for Partition
impl BlockDevice for Partition
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.
Auto Trait Implementations§
impl Freeze for Partition
impl !RefUnwindSafe for Partition
impl Send for Partition
impl Sync for Partition
impl Unpin for Partition
impl UnsafeUnpin for Partition
impl !UnwindSafe for Partition
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