wl-client 0.2.0

Safe client-side libwayland wrapper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use {
    crate::utils::block_on::block_on,
    std::{future::poll_fn, task::Poll},
};

#[test]
fn block_once() {
    let mut done = false;
    block_on(poll_fn(|ctx| {
        if done {
            Poll::Ready(())
        } else {
            ctx.waker().wake_by_ref();
            done = true;
            Poll::Pending
        }
    }));
}