pub struct DeviceInfo {
pub node: String,
pub name: String,
pub total_bytes: u64,
pub used_bytes: Option<u64>,
pub removable: bool,
pub ejectable: bool,
pub internal: bool,
pub boot: bool,
pub mounted: bool,
}Expand description
What the OS reports about a candidate device, authored by Formatter::probe
— never from user input. Carries no secret material (I12).
Fields§
§node: StringThe device node as the OS addresses it (e.g. /dev/disk4).
name: StringHuman label (volume / media name), best-effort; may be empty.
total_bytes: u64Total capacity in bytes (0 if the OS did not report it).
used_bytes: Option<u64>Bytes in use across mounted volumes, if the OS reported it.
removable: boolThe device’s media is removable from its mechanism (SD card, optical),
as opposed to fixed flash/SSD. Informational only — it is NOT the erase
safety predicate (a USB SSD reports Fixed yet is a perfectly safe,
intended target). The rail keys on Self::ejectable + external instead.
ejectable: boolThe device can be ejected from the running system (external bus). Internal disks are not ejectable. This — together with not-internal and not-boot — is the actual erase-safety predicate the rail enforces.
internal: boolThe device is internal/onboard — the opposite of an external stick.
boot: boolThe device backs the current boot/system volume.
mounted: boolAt least one volume on the device is currently mounted.
Implementations§
Source§impl DeviceInfo
impl DeviceInfo
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§fn clone(&self) -> DeviceInfo
fn clone(&self) -> DeviceInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceInfo
impl Debug for DeviceInfo
impl Eq for DeviceInfo
Source§impl PartialEq for DeviceInfo
impl PartialEq for DeviceInfo
Source§fn eq(&self, other: &DeviceInfo) -> bool
fn eq(&self, other: &DeviceInfo) -> bool
self and other values to be equal, and is used by ==.