4 releases (2 breaking)

0.2.0 Mar 18, 2025
0.1.2 Mar 18, 2025
0.1.1 Feb 21, 2025
0.1.0 Feb 21, 2025
0.0.0 Feb 6, 2025

#442 in Data structures

Download history 119/week @ 2025-02-04 13/week @ 2025-02-11 3368/week @ 2025-02-18 24685/week @ 2025-02-25 53744/week @ 2025-03-04 72149/week @ 2025-03-11 69837/week @ 2025-03-18 69440/week @ 2025-03-25 73074/week @ 2025-04-01 103940/week @ 2025-04-08 114429/week @ 2025-04-15 132491/week @ 2025-04-22 114318/week @ 2025-04-29

481,412 downloads per month
Used in 712 crates (2 directly)

MIT/Apache

275KB
7K SLoC

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.windows-collections]
version = "0.2"

Use the Windows collection types as needed:

use 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 windows_collections::*;
use windows_result::*;
use 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(())
}

Dependencies

~205–650KB
~15K SLoC