pub struct StorageInfo {
pub model: String,
pub storage_type: StorageType,
pub capacity_gb: f64,
pub available_gb: f64,
pub used_gb: f64,
pub mount_point: String,
pub file_system: Option<String>,
pub removable: bool,
pub read_speed_mb_s: Option<f32>,
pub write_speed_mb_s: Option<f32>,
}
Expand description
Storage device information
Fields§
§model: String
Device name/model
storage_type: StorageType
Storage type
capacity_gb: f64
Total capacity in GB
available_gb: f64
Available space in GB
used_gb: f64
Used space in GB
mount_point: String
Mount point or drive letter
file_system: Option<String>
File system type
removable: bool
Is removable
read_speed_mb_s: Option<f32>
Read speed in MB/s (if available)
write_speed_mb_s: Option<f32>
Write speed in MB/s (if available)
Implementations§
Source§impl StorageInfo
impl StorageInfo
Sourcepub fn drive_type(&self) -> &StorageType
pub fn drive_type(&self) -> &StorageType
Get storage type
Sourcepub fn capacity_gb(&self) -> f64
pub fn capacity_gb(&self) -> f64
Get total capacity in GB
Sourcepub fn available_gb(&self) -> f64
pub fn available_gb(&self) -> f64
Get available space in GB
Sourcepub fn usage_percent(&self) -> f64
pub fn usage_percent(&self) -> f64
Get usage percentage
Sourcepub fn has_free_space(&self, required_gb: f64) -> bool
pub fn has_free_space(&self, required_gb: f64) -> bool
Check if device has sufficient free space
Trait Implementations§
Source§impl Clone for StorageInfo
impl Clone for StorageInfo
Source§fn clone(&self) -> StorageInfo
fn clone(&self) -> StorageInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StorageInfo
impl Debug for StorageInfo
Source§impl<'de> Deserialize<'de> for StorageInfo
impl<'de> Deserialize<'de> for StorageInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StorageInfo
impl RefUnwindSafe for StorageInfo
impl Send for StorageInfo
impl Sync for StorageInfo
impl Unpin for StorageInfo
impl UnwindSafe for StorageInfo
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
Mutably borrows from an owned value. Read more