All Projects → smol-rs → waker-fn

smol-rs / waker-fn

Licence: other
Convert closures into wakers

Programming Languages

rust
11053 projects

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].