pub struct PathInfo { /* private fields */ }Expand description
Information about a filesystem path, including its type and mount status.
PathInfo represents both local and remote paths and provides methods
to inspect their characteristics in a platform-independent way.
Implementations§
Source§impl PathInfo
impl PathInfo
pub fn is_removable(&self) -> bool
pub fn is_fixed(&self) -> bool
pub fn is_remote(&self) -> bool
pub fn is_cdrom(&self) -> bool
pub fn is_ramdisk(&self) -> bool
pub fn is_status_mounted(&self) -> bool
pub fn is_status_disconnected(&self) -> bool
pub fn is_status_unknown(&self) -> bool
pub fn path(&self) -> &PathBuf
pub fn kind(&self) -> &PathType
pub fn status(&self) -> &PathStatus
pub fn remote_type(&self) -> Option<&RemoteType>
Sourcepub fn check_status(&mut self)
pub fn check_status(&mut self)
Updates the mount status of the path.
This function attempts to access the underlying filesystem to determine whether the path is currently mounted or disconnected. On network paths, this may perform a blocking I/O operation.
The status is updated based on the result of probing the path and is
stored in the status field.
Trait Implementations§
impl StructuralPartialEq for PathInfo
Auto Trait Implementations§
impl Freeze for PathInfo
impl RefUnwindSafe for PathInfo
impl Send for PathInfo
impl Sync for PathInfo
impl Unpin for PathInfo
impl UnwindSafe for PathInfo
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