#window #windows #async-version

wiard

Window handling library for Windows in Rust

18 releases

0.3.1 Oct 25, 2024
0.2.3 Oct 11, 2024
0.1.9 Jul 27, 2024
0.1.5 Mar 4, 2024
0.1.1 Nov 26, 2023

#301 in GUI

Download history 3/week @ 2024-07-14 77/week @ 2024-07-21 45/week @ 2024-07-28 189/week @ 2024-08-04 24/week @ 2024-08-11 318/week @ 2024-08-18 5/week @ 2024-08-25 12/week @ 2024-09-15 20/week @ 2024-09-22 212/week @ 2024-09-29 154/week @ 2024-10-06 161/week @ 2024-10-13 118/week @ 2024-10-20 23/week @ 2024-10-27

471 downloads per month
Used in 2 crates

MIT license

130KB
4K SLoC

wiard

Window handling library for Windows in Rust

Simple examples

sync version

fn main() {
    let mut event_rx = wiard::EventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .build()
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv() else {
            break;
        };
        println!("{event:?}");
    }
}

async version

#[tokio::main]
async fn main() {
    let mut event_rx = wiard::AsyncEventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .await
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv().await else {
            break;
        };
        println!("{event:?}");
    }
}

License

This library is licensed under the MIT license.


lib.rs:

Window handing library for Windows in Rust

Simple examples

sync version

fn main() {
    let mut event_rx = wiard::EventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .build()
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv() else {
            break;
        };
        println!("{event:?}");
    }
}

async version

#[tokio::main]
async fn main() {
    let mut event_rx = wiard::AsyncEventReceiver::new();
    let _window = wiard::Window::builder(&event_rx)
        .await
        .unwrap();
    loop {
        let Some((event, _)) = event_rx.recv().await else {
            break;
        };
        println!("{event:?}");
    }
}

Note

wiard use WM_APP. Don't post directly WM_APP to wiard's UI thread.

Dependencies

~135MB
~2M SLoC