2 stable releases

1.1.0 Aug 26, 2020
1.0.0 May 16, 2020

#3 in #callback

Download history 38721/week @ 2020-12-25 54151/week @ 2021-01-01 64908/week @ 2021-01-08 65158/week @ 2021-01-15 67955/week @ 2021-01-22 71239/week @ 2021-01-29 68415/week @ 2021-02-05 70857/week @ 2021-02-12 77591/week @ 2021-02-19 78856/week @ 2021-02-26 75429/week @ 2021-03-05 77113/week @ 2021-03-12 74815/week @ 2021-03-19 78909/week @ 2021-03-26 78230/week @ 2021-04-02 69961/week @ 2021-04-09

271,664 downloads per month
Used in 1,238 crates (8 directly)

Apache-2.0 OR MIT

8KB

waker-fn

Build License Cargo Documentation

Convert closures into wakers.

A Waker is just a fancy callback. This crate converts regular closures into wakers.

Examples

use waker_fn::waker_fn;

let waker = waker_fn(|| println!("woken"));

waker.wake_by_ref(); // Prints "woken".
waker.wake();        // Prints "woken".

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps