winpty-rs-windows-registry

Crates.iowinpty-rs-windows-registry
lib.rswinpty-rs-windows-registry
version0.5.2
created_at2025-08-04 21:11:01.129531+00
updated_at2025-08-04 21:11:01.129531+00
descriptionWindows registry
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id1781186
size50,935
Edgar Andrés Margffoy Tuay (andfoy)

documentation

README

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.winpty-rs-windows-registry]
version = "0.5"

Read and write registry keys and values as needed:

use winpty_rs_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(())
}

Use the options() method for even more control:

use winpty_rs_windows_registry::*;

fn main() -> Result<()> {
    let tx = Transaction::new()?;

    let key = CURRENT_USER
        .options()
        .read()
        .write()
        .create()
        .transaction(&tx)
        .open("software\\windows-rs")?;

    key.set_u32("name", 123)?;

    tx.commit()?;

    Ok(())
}
Commit count: 1734

cargo fmt