pub struct Disk {
pub name: String,
pub rotational: Option<bool>,
pub removable: Option<bool>,
pub ram: bool,
pub lvm: bool,
pub crypted: bool,
}
Expand description
what we have most looking like a physical device
Fields
name: String
a name, like “sda”, “sdc”, “nvme0n1”, etc.
rotational: Option<bool>
true for HDD, false for SSD, None for unknown. This information isn’t reliable for USB devices
removable: Option<bool>
whether the system thinks the media is removable. Seems reliable when not mapped
ram: bool
whether it’s a RAM disk
lvm: bool
whether it’s on LVM
crypted: bool
whether it’s a crypted disk
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl UnwindSafe for Disk
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more