wl-client 0.2.1

Safe client-side libwayland wrapper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::utils::block_on::block_on;
use std::future::poll_fn;
use std::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
        }
    }));
}