Skip to content

Commit

Permalink
Update documentation and examples for version 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gentoo90 committed May 22, 2021
1 parent b82d859 commit 9ea048c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Current features:
* read and write values
* seamless conversion between `REG_*` types and rust primitives
* `String` and `OsString` <= `REG_SZ`, `REG_EXPAND_SZ` or `REG_MULTI_SZ`
* `String`, `&str` and `OsStr` => `REG_SZ`
* `String`, `&str`, `OsString`, `&OsStr` => `REG_SZ`
* `Vec<String>`, `Vec<OsString>` <= `REG_MULTI_SZ`
* `Vec<String>`, `Vec<&str>`, `Vec<OsString>`, `Vec<&OsStr>` => `REG_MULTI_SZ`
* `u32` <=> `REG_DWORD`
* `u64` <=> `REG_QWORD`
* Iteration through key names and through values
Expand Down Expand Up @@ -79,6 +81,11 @@ fn main() -> io::Result<()> {
key.delete_value("TestSZ")?;
println!("TestSZ = {}", sz_val);

key.set_value("TestMultiSZ", &vec!["written", "by", "Rust"])?;
let multi_sz_val: Vec<String> = key.get_value("TestMultiSZ")?;
key.delete_value("TestMultiSZ")?;
println!("TestMultiSZ = {:?}", multi_sz_val);

key.set_value("TestDWORD", &1234567890u32)?;
let dword_val: u32 = key.get_value("TestDWORD")?;
println!("TestDWORD = {}", dword_val);
Expand Down
5 changes: 5 additions & 0 deletions examples/basic_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ fn main() -> io::Result<()> {
key.delete_value("TestSZ")?;
println!("TestSZ = {}", sz_val);

key.set_value("TestMultiSZ", &vec!["written", "by", "Rust"])?;
let multi_sz_val: Vec<String> = key.get_value("TestMultiSZ")?;
key.delete_value("TestMultiSZ")?;
println!("TestMultiSZ = {:?}", multi_sz_val);

key.set_value("TestDWORD", &1_234_567_890u32)?;
let dword_val: u32 = key.get_value("TestDWORD")?;
println!("TestDWORD = {}", dword_val);
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
//! key.delete_value("TestSZ")?;
//! println!("TestSZ = {}", sz_val);
//!
//! key.set_value("TestMultiSZ", &vec!["written", "by", "Rust"])?;
//! let multi_sz_val: Vec<String> = key.get_value("TestMultiSZ")?;
//! key.delete_value("TestMultiSZ")?;
//! println!("TestMultiSZ = {:?}", multi_sz_val);
//!
//! key.set_value("TestDWORD", &1234567890u32)?;
//! let dword_val: u32 = key.get_value("TestDWORD")?;
//! println!("TestDWORD = {}", dword_val);
Expand Down

0 comments on commit 9ea048c

Please sign in to comment.