waker-fn

Crates.iowaker-fn
lib.rswaker-fn
version1.2.0
sourcesrc
created_at2020-05-16 17:22:12.647555
updated_at2024-05-13 00:24:30.171231
descriptionConvert closures into wakers
homepagehttps://github.com/smol-rs/waker-fn
repositoryhttps://github.com/smol-rs/waker-fn
max_upload_size
id242430
size17,318
admins (github:smol-rs:admins)

documentation

https://docs.rs/waker-fn

README

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.

Commit count: 33

cargo fmt