pub struct TrashDir { /* private fields */ }
Expand description
A trash directory represented by a path.
Implementations§
source§impl TrashDir
impl TrashDir
sourcepub fn get_home_trash() -> Self
pub fn get_home_trash() -> Self
Gets your user’s “home” trash directory.
According to Trash spec v1.0:
For every user2 a “home trash” directory MUST be available. Its name and location are $XDG_DATA_HOME/Trash $XDG_DATA_HOME is the base directory for user-specific data, as defined in the Desktop Base Directory Specification.
sourcepub fn from_opt(opt: Option<impl AsRef<Path>>) -> Self
pub fn from_opt(opt: Option<impl AsRef<Path>>) -> Self
Create a trash directory from an optional path
If the option is None, then the home trash will be selected instead.
sourcepub fn mkdir(&self, fs: &impl Filesystem) -> Result<()>
pub fn mkdir(&self, fs: &impl Filesystem) -> Result<()>
Actually create the directory on disk corresponding to this trash directory
sourcepub fn files_dir(&self, fs: &impl Filesystem) -> Result<PathBuf>
pub fn files_dir(&self, fs: &impl Filesystem) -> Result<PathBuf>
Get the files
directory
sourcepub fn info_dir(&self, fs: &impl Filesystem) -> Result<PathBuf>
pub fn info_dir(&self, fs: &impl Filesystem) -> Result<PathBuf>
Get the info
directory
sourcepub fn check_info_dir(&self, fs: &impl Filesystem) -> Result<Option<PathBuf>>
pub fn check_info_dir(&self, fs: &impl Filesystem) -> Result<Option<PathBuf>>
Get the info
directory
sourcepub fn iter(&self, fs: &impl Filesystem) -> Result<TrashDirIter>
pub fn iter(&self, fs: &impl Filesystem) -> Result<TrashDirIter>
Iterate over trash infos within this trash directory
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrashDir
impl RefUnwindSafe for TrashDir
impl Send for TrashDir
impl Sync for TrashDir
impl Unpin for TrashDir
impl UnwindSafe for TrashDir
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