Trait MediaDirsExt

pub trait MediaDirsExt: Sized

Darwin-specific extensions to fs::MediaDirs.

Required Methods

fn sysdir() -> Result<Self>

Load the standard user directory paths for the current user.

The produced directory paths are not guaranteed to be the canonical paths to the directories; they are allowed to be sandbox-redirected paths as long as the directory is accessible there.

The loaded common directories are:

MediaDirs NSSearchPathDirectory
desktop NSDesktopDirectory (~/Desktop)
documents NSDocumentDirectory (~/Documents)
downloads NSDownloadsDirectory (~/Downloads)
music NSMusicDirectory (~/Music)
pictures NSPicturesDirectory (~/Pictures)
videos NSMoviesDirectory (~/Movies)

Errors

Errors if the the user home cannot be determined.

Implementation-specific behavior

Uses the sysdir(3) API from libSystem to discover the standard user directories.

This behavior may change in the future. One example change that we explicitly reserve the right to make is to load additional common directories not currently in this list.