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

#36 in #event-stream

Download history 67/week @ 2024-07-20 65/week @ 2024-07-27 57/week @ 2024-08-03 89/week @ 2024-08-10 57/week @ 2024-08-17 54/week @ 2024-08-24 71/week @ 2024-08-31 54/week @ 2024-09-07 58/week @ 2024-09-14 93/week @ 2024-09-21 77/week @ 2024-09-28 17/week @ 2024-10-05 44/week @ 2024-10-12 39/week @ 2024-10-19 37/week @ 2024-10-26 85/week @ 2024-11-02

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

MIT/Apache

58KB
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.6–13MB
~160K SLoC