[−][src]Trait disk_types::BlockDeviceExt
Methods that all block devices share, whether they are partitions or disks.
This trait is required to implement other disk traits.
Required methods
fn get_device_path(&self) -> &Path
The path to the block device, such as /dev/sda1
, or /dev/data/root
.
Provided methods
fn sys_block_path(&self) -> PathBuf
The sys path of the block device.
fn is_read_only(&self) -> bool
Checks if the device is a read-only device.
fn is_removable(&self) -> bool
fn is_rotational(&self) -> bool
fn get_mount_point(&self) -> Option<&Path>
The mount point of this block device, if it is mounted.
fn get_device_name(&self) -> &str
The name of the device, such as sda1
.
fn get_sectors(&self) -> u64
The combined total number of sectors on the disk.
fn get_logical_block_size(&self) -> u64
The size of each logical sector, in bytes.
fn get_physical_block_size(&self) -> u64
The size of each logical sector, in bytes.