pub trait MediaDirsExt: Sized {
// Required method
fn sysdir() -> Result<Self>;
}ⓘ This trait cannot be implemented outside
std.🔬This is a nightly-only experimental API. (
fs_media_dirs #162083)Available on Apple only.
Expand description
Darwin-specific extensions to fs::MediaDirs.
Required Methods§
Sourcefn sysdir() -> Result<Self>
🔬This is a nightly-only experimental API. (fs_media_dirs #162083)
fn sysdir() -> Result<Self>
fs_media_dirs #162083)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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".