known-folders

Crates.ioknown-folders
lib.rsknown-folders
version1.2.0
sourcesrc
created_at2023-05-18 01:18:04.422786
updated_at2024-08-14 04:48:30.387476
descriptionA safe wrapper around the Known Folders API on Windows
homepagehttps://github.com/artichoke/known-folders-rs
repositoryhttps://github.com/artichoke/known-folders-rs
max_upload_size
id867333
size87,265
crates.io publishers (github:artichoke:crates-io-publishers)

documentation

https://docs.rs/known-folders

README

known-folders-rs

GitHub Actions Discord Twitter
Crate API API trunk

Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID on Windows systems using SHGetKnownFolderPath and the Known Folders API.

The Known Folders API first appeared in Windows Vista.

Usage

Add this to your Cargo.toml:

[dependencies]
known-folders = "1.2.0"

Then resolve well-known directories like this:

use known_folders::{get_known_folder_path, KnownFolder};

let profile_dir = get_known_folder_path(KnownFolder::Profile);

You can test this crate works on your platform by running the example:

cargo run --example get_profile_dir

Implementation

known-folders-rs binds directly to Win32 using windows_sys. Semver-incompatible windows_sys upgrades can be made in minor releases.

Note that this crate is completely empty on non-Windows platforms.

Minimum Supported Rust Version

This crate requires at least Rust 1.60.0. This version can be bumped in minor releases.

License

known-folders-rs is distributed under the terms of either the MIT License or the Apache License (Version 2.0).

Commit count: 83

cargo fmt