Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

winreg-rs

> 编程语言
Open source

Rust bindings to MS Windows Registry API

193 stars0 likes0 views
WebsiteGitHub

About

Rust bindings to MS Windows Registry API

winreg Github Actions Winreg on crates.io Winreg on docs.rs

Rust bindings to MS Windows Registry API. Work in progress.

Current features:

  • Basic registry operations:
    • open/create/delete/rename keys
    • load application hive from a file
    • read and write values
    • seamless conversion between REG_* types and rust primitives
      • String and OsString REG_SZ
      • Vec, Vec , Vec, Vec, Vec=>REG_MULTI_SZ`
      • u32 REG_DWORD
      • u64 REG_QWORD
  • Iteration through key names and through values
  • Transactions
  • Transacted serialization of rust types into/from registry (only primitives, Options, structures and maps for now)

Usage

Basic usage

toml
# Cargo.toml
[dependencies]
winreg = "0.56"
…

Iterators

rust
use std::io;
use winreg::RegKey;
use winreg::enums::*;

fn main() -> io::Result {
    println!("File extensions, registered in system:");
    for i in RegKey::predef(HKEY_CLASSES_ROOT)
        .enum_keys().map(|x| x.unwrap())
        .filter(|x| x.starts_with("."))
    {
        println!("{}", i);
    }

    let system = RegKey::predef(HKEY_LOCAL_MACHINE)
        .open_subkey("HARDWARE\\DESCRIPTION\\System")?;
    for (name, value) in system.enum_values().map(|x| x.unwrap()) {
        println!("{} = {:?}", name, value);
    }

    Ok(())
}

Transactions

toml
# Cargo.toml
[dependencies]
winreg = { version = "0.56", features = ["transactions"] }
…

Serialization

toml
# Cargo.toml
[dependencies]
winreg = { version = "0.56", features = ["serialization-serde"] }
serde = "1"
serde_derive = "1"
…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustregistryrustwinapiwindows

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言