2 stable releases

1.1.0 Aug 26, 2020
1.0.0 May 16, 2020

#436 in Concurrency

Download history 235669/week @ 2022-11-29 232116/week @ 2022-12-06 225668/week @ 2022-12-13 174087/week @ 2022-12-20 130621/week @ 2022-12-27 220455/week @ 2023-01-03 240725/week @ 2023-01-10 246252/week @ 2023-01-17 257737/week @ 2023-01-24 266863/week @ 2023-01-31 278418/week @ 2023-02-07 273812/week @ 2023-02-14 286413/week @ 2023-02-21 281047/week @ 2023-02-28 284927/week @ 2023-03-07 235753/week @ 2023-03-14

1,129,357 downloads per month
Used in 2,579 crates (26 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