pub struct PhysicalDisk {
pub device_path: String,
pub name: String,
pub size_bytes: u64,
pub logical_sector_size: u32,
pub physical_sector_size: u32,
pub model: Option<String>,
pub serial: Option<String>,
pub removable: bool,
pub read_only: bool,
pub synthesized: bool,
pub partitions: Vec<Partition>,
}Expand description
A whole physical (or, on macOS, synthesized) disk on the live system.
size_bytes and the sector sizes come from the OS/driver layer, not from the
on-disk partition table — only the kernel knows the device’s true geometry.
Fields§
§device_path: StringOS path to open for raw access (/dev/disk0, /dev/sda,
\\.\PhysicalDrive0).
name: StringShort kernel identifier (disk0, sda, PhysicalDrive0).
size_bytes: u64Total device size in bytes, as reported by the driver.
logical_sector_size: u32Smallest addressable I/O unit (logical sector), in bytes.
physical_sector_size: u32Physical sector size in bytes (4096 on 4Kn/512e media; may exceed
logical_sector_size).
model: Option<String>Device model string, when the driver exposes one.
serial: Option<String>Device serial number, when the driver exposes one.
removable: boolRemovable media (USB stick, SD card, optical).
read_only: boolDevice is write-protected / read-only at the driver level.
synthesized: boolNot a backing physical device but a kernel-synthesized one (macOS APFS container, Linux device-mapper/LVM). Real evidence imaging targets the backing physical disk; synthesized disks are shown for completeness.
partitions: Vec<Partition>Partitions/slices carved out of this disk, in on-disk order.
Trait Implementations§
Source§impl Clone for PhysicalDisk
impl Clone for PhysicalDisk
Source§fn clone(&self) -> PhysicalDisk
fn clone(&self) -> PhysicalDisk
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 PhysicalDisk
impl Debug for PhysicalDisk
impl Eq for PhysicalDisk
Source§impl PartialEq for PhysicalDisk
impl PartialEq for PhysicalDisk
Source§fn eq(&self, other: &PhysicalDisk) -> bool
fn eq(&self, other: &PhysicalDisk) -> bool
self and other values to be equal, and is used by ==.