2 stable releases

1.1.0 Aug 26, 2020
1.0.0 May 16, 2020

#3 in #waker

Download history 89270/week @ 2021-07-01 93159/week @ 2021-07-08 91150/week @ 2021-07-15 97096/week @ 2021-07-22 106993/week @ 2021-07-29 97494/week @ 2021-08-05 103121/week @ 2021-08-12 136559/week @ 2021-08-19 110302/week @ 2021-08-26 113754/week @ 2021-09-02 129129/week @ 2021-09-09 119631/week @ 2021-09-16 107655/week @ 2021-09-23 113071/week @ 2021-09-30 136984/week @ 2021-10-07 114182/week @ 2021-10-14

337,395 downloads per month
Used in 1,512 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