11 releases (6 stable)

new 1.2.2 May 16, 2022
1.2.1 Oct 26, 2021
1.2.0 Jun 20, 2021
1.1.0 Oct 25, 2020
0.0.2 Nov 21, 2014

#21 in Windows APIs

Download history 61/week @ 2022-01-28 248/week @ 2022-02-04 132/week @ 2022-02-11 134/week @ 2022-02-18 93/week @ 2022-02-25 122/week @ 2022-03-04 274/week @ 2022-03-11 115/week @ 2022-03-18 98/week @ 2022-03-25 135/week @ 2022-04-01 260/week @ 2022-04-08 163/week @ 2022-04-15 117/week @ 2022-04-22 169/week @ 2022-04-29 180/week @ 2022-05-06 339/week @ 2022-05-13

853 downloads per month
Used in less than 6 crates

MIT/Apache

41KB
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.

# use registry::{Hive, Security};
let regkey = Hive::CurrentUser.open(r"some\nested\path", Security::Read)?;
# Ok::<(), registry::Error>(())

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

# use registry::{Data, Hive, Security};
# let regkey = Hive::CurrentUser.open(r"some\nested\path", Security::Read)?;
regkey.set_value("SomeValue", &Data::U32(42))?;
assert!(matches!(regkey.value("SomeValue")?, Data::U32(42)));
# Ok::<(), registry::Error>(())

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

Dependencies

~0.5–1MB
~20K SLoC