[][src]Struct xdg_user::UserDirs

pub struct UserDirs { /* fields omitted */ }

This crates main and only struct, allows you to access the paths to all the user directories

Methods

impl UserDirs[src]

pub fn new() -> Result<Self, Error>[src]

Attempts to read and parse the ${XDG_COFNIG_HOME}/user-dirs.dirs file

Errors

  • Home folder was not found
  • Failed to read the user-dirs.dirs file
  • Failed to parse the user-dirs.dirs file

pub fn desktop(&self) -> Option<&Path>[src]

Returns an absolute path to users desktop directory (XDG_DESKTOP_DIR), if found

pub fn documents(&self) -> Option<&Path>[src]

Returns an absolute path to users desktop directory (XDG_DESKTOP_DIR), if found

pub fn downloads(&self) -> Option<&Path>[src]

Returns an absolute path to users downloads directory (XDG_DOWNLOAD_DIR), if found

pub fn music(&self) -> Option<&Path>[src]

Returns an absolute path to users music directory (XDG_MUSIC_DIR), if found

pub fn pictures(&self) -> Option<&Path>[src]

Returns an absolute path to users pictures directory (XDG_PICTURES_DIR), if found

pub fn public(&self) -> Option<&Path>[src]

Returns an absolute path to users public share directory (XDG_PUBLICSHARE_DIR), if found

pub fn templates(&self) -> Option<&Path>[src]

Returns an absolute path to users templates directory (XDG_TEMPLATES_DIR), if found

pub fn videos(&self) -> Option<&Path>[src]

Returns an absolute path to users videos directory (XDG_VIDEOS_DIR), if found

Trait Implementations

impl Debug for UserDirs[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, 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.