[][src]Struct lfs_core::Disk

pub struct Disk {
    pub name: String,
    pub rotational: Option<bool>,
    pub removable: Option<bool>,
}

a "block 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.

Implementations

impl Disk[src]

pub fn new(name: String) -> Self[src]

pub fn disk_type(&self) -> &'static str[src]

a synthetic code trying to express the essence of the type of media, an empty str being returned when information couldn't be gathered. This code is for humans and may change in future minor versions.

Trait Implementations

impl Clone for Disk[src]

impl Debug for Disk[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.