3 stable releases

1.1.1 Sep 25, 2023
1.1.0 Aug 26, 2020
1.0.0 May 16, 2020

#50 in Concurrency

Download history 393502/week @ 2023-11-21 450008/week @ 2023-11-28 454490/week @ 2023-12-05 413615/week @ 2023-12-12 345958/week @ 2023-12-19 233343/week @ 2023-12-26 400188/week @ 2024-01-02 437381/week @ 2024-01-09 499972/week @ 2024-01-16 527900/week @ 2024-01-23 639013/week @ 2024-01-30 478160/week @ 2024-02-06 466854/week @ 2024-02-13 475751/week @ 2024-02-20 491057/week @ 2024-02-27 406287/week @ 2024-03-05

1,923,177 downloads per month
Used in 3,299 crates (28 directly)

Apache-2.0 OR MIT

7KB

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