Crate windows_registry

source
Expand description

§Windows registry

The windows-registry crate provides simple, safe, and efficient access to the Windows registry.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-registry]
version = "0.3"

Read and write registry keys and values as needed:

use windows_registry::*;

fn main() -> Result<()> {
    let key = CURRENT_USER.create("software\\windows-rs")?;

    key.set_u32("number", 123)?;
    key.set_string("name", "Rust")?;

    println!("{}", key.get_u32("number")?);
    println!("{}", key.get_string("name")?);

    Ok(())
}

Structs§

Enums§

  • The possible types that a registry value could have.

Constants§

  • The predefined HKEY_CLASSES_ROOT registry key.
  • The predefined HKEY_CURRENT_CONFIG registry key.
  • The predefined HKEY_CURRENT_USER registry key.
  • The predefined HKEY_LOCAL_MACHINE registry key.
  • The predefined HKEY_USERS registry key.

Type Aliases§

  • A specialized Result type that provides Windows error information.