[][src]Struct garbage::TrashDir

pub struct TrashDir(pub PathBuf);

A trash directory represented by a path.

Implementations

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 check_info_dir(&self) -> Result<Option<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

impl Clone for TrashDir[src]

impl Debug for TrashDir[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.