Struct lsblk::BlockDevice
source · pub struct BlockDevice {
pub name: String,
pub fullname: PathBuf,
pub diskseq: Option<String>,
pub path: Option<String>,
pub uuid: Option<String>,
pub partuuid: Option<String>,
pub label: Option<String>,
pub partlabel: Option<String>,
pub id: Option<String>,
}Expand description
A representation of a block-device
Fields§
§name: Stringthe filename of the block-device.
fullname: PathBufThe full name of the block-device, which is basically /dev/{name}.
diskseq: Option<String>The diskseq of the device as in /dev/disk/by-diskseq/.
path: Option<String>The path (not the filesystem!) of the device as in /dev/disk/by-path.
uuid: Option<String>The device UUID.
partuuid: Option<String>The UUID of a partition (not the same as device UUID).
label: Option<String>The label of the partition.
partlabel: Option<String>The partition label (not the same as label), as in /dev/disk/by-partlabel)
id: Option<String>The id of the device as in /dev/disk/by-id/.
Implementations§
source§impl BlockDevice
impl BlockDevice
sourcepub fn list() -> Result<Vec<Self>, LsblkError>
pub fn list() -> Result<Vec<Self>, LsblkError>
sourcepub const fn is_disk(&self) -> bool
pub const fn is_disk(&self) -> bool
Returns true if and only if the device is a storage disk and is not a partition.
The implementation currently is just:
!self.is_part()
sourcepub const fn is_physical(&self) -> bool
pub const fn is_physical(&self) -> bool
Determines if the block-device is considered to be physical. This can be a partition or a disk.
A “physical” disk is one that has a path as in /dev/disk/by-path
The implementation currently is just:
self.path.is_some()
Trait Implementations§
source§impl Clone for BlockDevice
impl Clone for BlockDevice
source§fn clone(&self) -> BlockDevice
fn clone(&self) -> BlockDevice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BlockDevice
impl Debug for BlockDevice
source§impl Default for BlockDevice
impl Default for BlockDevice
source§fn default() -> BlockDevice
fn default() -> BlockDevice
Auto Trait Implementations§
impl Freeze for BlockDevice
impl RefUnwindSafe for BlockDevice
impl Send for BlockDevice
impl Sync for BlockDevice
impl Unpin for BlockDevice
impl UnwindSafe for BlockDevice
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)