winpty-rs-windows-collections

Crates.iowinpty-rs-windows-collections
lib.rswinpty-rs-windows-collections
version0.2.0
created_at2025-08-04 22:02:11.122282+00
updated_at2025-08-04 22:02:11.122282+00
descriptionWindows collection types
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id1781263
size107,981
Edgar Andrés Margffoy Tuay (andfoy)

documentation

README

Windows collection types

The windows-collections crate provides stock collection support for Windows APIs.

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

[dependencies.winpty-rs-windows-collections]
version = "0.2"

Use the Windows collection types as needed:

use winpty_rs_windows_collections::*;

let numbers = IIterable::<i32>::from(vec![1, 2, 3]);

for value in numbers {
    println!("{value}");
}

Naturally, the Windows collection types work with other Windows crates:

use winpty_rs_windows_collections::*;
use winpty_rs_windows_result::*;
use winpty_rs_windows_strings::*;

fn main() -> Result<()> {
    let greetings =
        IVectorView::<HSTRING>::from(vec![HSTRING::from("hello"), HSTRING::from("world")]);

    for value in greetings {
        println!("{value}");
    }

    let map = std::collections::BTreeMap::from([("one".into(), 1), ("two".into(), 2)]);
    let map = IMapView::<HSTRING, i32>::from(map);

    assert_eq!(map.Lookup(h!("one"))?, 1);
    assert_eq!(map.Lookup(h!("two"))?, 2);

    Ok(())
}
Commit count: 1734

cargo fmt