pub struct Disk {
mount_point: PathBuf,
display_name: String,
is_removable: bool,
}
Expand description
Wrapper above the sysinfo::Disk
struct.
Used for helper functions and so that more flexibility is guaranteed in the future if
the names of the disks are generated dynamically.
Fields§
§mount_point: PathBuf
§display_name: String
§is_removable: bool
Implementations§
Source§impl Disk
impl Disk
Sourcepub fn new(
name: Option<&str>,
mount_point: &Path,
is_removable: bool,
canonicalize_paths: bool,
) -> Self
pub fn new( name: Option<&str>, mount_point: &Path, is_removable: bool, canonicalize_paths: bool, ) -> Self
Creates a new disk with the given name and mount point
Sourcepub fn from_sysinfo_disk(disk: &Disk, canonicalize_paths: bool) -> Self
pub fn from_sysinfo_disk(disk: &Disk, canonicalize_paths: bool) -> Self
Create a new Disk object based on the data of a sysinfo::Disk
.
Sourcepub fn mount_point(&self) -> &Path
pub fn mount_point(&self) -> &Path
Returns the mount point of the disk
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Returns the display name of the disk
Sourcepub const fn is_removable(&self) -> bool
pub const fn is_removable(&self) -> bool
Returns true if the disk is removable
Trait Implementations§
impl Eq for Disk
impl StructuralPartialEq for Disk
Auto Trait Implementations§
impl Freeze for Disk
impl RefUnwindSafe for Disk
impl Send for Disk
impl Sync for Disk
impl Unpin for Disk
impl UnwindSafe for Disk
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