Crates.io | waker-fn |
lib.rs | waker-fn |
version | 1.2.0 |
source | src |
created_at | 2020-05-16 17:22:12.647555 |
updated_at | 2024-05-13 00:24:30.171231 |
description | Convert closures into wakers |
homepage | https://github.com/smol-rs/waker-fn |
repository | https://github.com/smol-rs/waker-fn |
max_upload_size | |
id | 242430 |
size | 17,318 |
Convert closures into wakers.
A Waker
is just a fancy callback. This crate converts regular closures into wakers.
use waker_fn::waker_fn;
let waker = waker_fn(|| println!("woken"));
waker.wake_by_ref(); // Prints "woken".
waker.wake(); // Prints "woken".
Licensed under either of
at your option.
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.