[][src]Trait disk_types::BlockDeviceExt

pub trait BlockDeviceExt {
    fn get_device_path(&self) -> &Path;

    fn sys_block_path(&self) -> PathBuf { ... }
fn is_read_only(&self) -> bool { ... }
fn is_removable(&self) -> bool { ... }
fn is_rotational(&self) -> bool { ... }
fn get_mount_point(&self) -> Option<&Path> { ... }
fn get_device_name(&self) -> &str { ... }
fn get_sectors(&self) -> u64 { ... }
fn get_logical_block_size(&self) -> u64 { ... }
fn get_physical_block_size(&self) -> u64 { ... } }

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.

Loading content...

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

Checks if the device is a removable device.

Notes

This is only applicable for disk devices.

fn is_rotational(&self) -> bool

Checks if the device is a rotational device.

Notes

This is only applicable for disk devices.

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.

Loading content...

Implementors

Loading content...