#async #window

blinds

Wrap an async abstraction over a window

19 releases

0.2.0 Sep 12, 2020
0.1.6 Jun 1, 2020
0.1.5 May 23, 2020
0.1.4 Apr 25, 2020
0.1.0-alpha2 Nov 19, 2019

#315 in Web programming

Download history 14/week @ 2020-12-24 64/week @ 2020-12-31 60/week @ 2021-01-07 89/week @ 2021-01-14 85/week @ 2021-01-21 51/week @ 2021-01-28 42/week @ 2021-02-04 79/week @ 2021-02-11 115/week @ 2021-02-18 80/week @ 2021-02-25 99/week @ 2021-03-04 58/week @ 2021-03-11 68/week @ 2021-03-18 158/week @ 2021-03-25 40/week @ 2021-04-01 70/week @ 2021-04-08

302 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

57KB
1.5K SLoC

blinds

blinds covers up the details of your windowing for you, by providing an async API.

use blinds::{run, Event, EventStream, Key, Settings, Window};

fn main() {
    run(Settings::default(), app);
}

async fn app(_window: Window, mut events: EventStream) {
    loop {
        while let Some(ev) = events.next_event().await {
            println!("{:?}", ev);
        }
    }
}

lib.rs:

blinds covers up the details of your windowing for you, by providing an async API.

A quick example of some code that prints all incoming events:

use blinds::{run, Event, EventStream, Key, Settings, Window};

run(Settings::default(), app);

async fn app(_window: Window, mut events: EventStream) {
    loop {
        while let Some(ev) = events.next_event().await {
            println!("{:?}", ev);
        }
    }
}

The core of blinds is run, which executes your app and provides your Window and EventStream instances.

Dependencies

~0.7–5MB
~105K SLoC