12 releases (7 stable)

1.2.3 Mar 24, 2023
1.2.2 May 16, 2022
1.2.1 Oct 26, 2021
1.2.0 Jun 20, 2021
0.0.2 Nov 21, 2014

#22 in Windows APIs

Download history 494/week @ 2023-12-05 450/week @ 2023-12-12 274/week @ 2023-12-19 312/week @ 2023-12-26 454/week @ 2024-01-02 390/week @ 2024-01-09 627/week @ 2024-01-16 525/week @ 2024-01-23 586/week @ 2024-01-30 763/week @ 2024-02-06 896/week @ 2024-02-13 1006/week @ 2024-02-20 1291/week @ 2024-02-27 1420/week @ 2024-03-05 1374/week @ 2024-03-12 1160/week @ 2024-03-19

5,516 downloads per month
Used in 15 crates (11 directly)

MIT/Apache

42KB
1K SLoC

Registry

Documentation Actions Status

A convenient crate for safely accessing and mutating the Windows Registry.

This crate only supported versions of Windows 8.1 and newer. Usage on Windows 7 or 8 may work, subject to various Win32 API limitations. These limitations will not be documented in this crate, so if you are unfamiliar with the Win32 variants of these functions, stick to Windows 8.1 or newer.

License

The registry crate is licensed under either of

at your option.


lib.rs:

Registry

A convenient crate for safely accessing and mutating the Windows Registry.

Usage

In general, you will want to access a key from a Hive. This crate automatically handles the conversion of String and str into a UTF-16 string suitable for FFI usage.

let regkey = Hive::CurrentUser.open(r"some\nested\path", Security::Read)?;

A RegKey has all necessary functionality for querying subkeys, values within a key, and accessing key value data.

regkey.set_value("SomeValue", &Data::U32(42))?;
assert!(matches!(regkey.value("SomeValue")?, Data::U32(42)));

RegKeys also support iteration of all subkeys with the keys() function, and all values with the values() function.

Dependencies

~0.6–1.3MB
~25K SLoC