[−][src]Struct garbage::TrashDir
A trash directory represented by a path.
Methods
impl TrashDir
[src]
pub fn from(path: impl AsRef<Path>) -> Self
[src]
Constructor for a new trash directory.
pub fn get_home_trash() -> Self
[src]
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.
pub fn from_opt(opt: Option<impl AsRef<Path>>) -> Self
[src]
Create a trash directory from an optional path
If the option is None, then the home trash will be selected instead.
pub fn create(&self) -> Result<(), Error>
[src]
Actually create the directory on disk corresponding to this trash directory
pub fn path(&self) -> &Path
[src]
Returns the path to this trash directory.
pub fn files_dir(&self) -> Result<PathBuf, Error>
[src]
Get the files
directory
pub fn info_dir(&self) -> Result<PathBuf, Error>
[src]
Get the info
directory
pub fn iter(&self) -> Result<TrashDirIter, Error>
[src]
Iterate over trash infos within this trash directory
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TrashDir
impl Send for TrashDir
impl Sync for TrashDir
impl Unpin for TrashDir
impl UnwindSafe for TrashDir
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,