Trait MediaDirsExt
pub trait MediaDirsExt: Sized
Windows-specific extensions to fs::MediaDirs.
Required Methods
fn known_folders() -> Result<Self>Load the known user folder paths using the Known Folders API.
The loaded known folders are:
MediaDirsKNOWNFOLDERIDdesktopFOLDERID_Desktop(%USERPROFILE%\Desktop)documentsFOLDERID_Documents(%USERPROFILE%\Documents)downloadsFOLDERID_Downloads(%USERPROFILE%\Downloads)musicFOLDERID_Music(%USERPROFILE%\Music)picturesFOLDERID_Pictures(%USERPROFILE%\Pictures)videosFOLDERID_Videos(%USERPROFILE%\Videos)Errors
Errors if the underlying system discovery API returns an error. The lack of a configured path is not considered an error and results in a
Nonevalue.Implementation-specific behavior
Calls
SHGetKnownFolderPathfor the current user once for each known folder. Does not create the folder if missing.COM should be initialized on the thread that calls this function or else it may return unexpected errors.
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.