Expand description

A waker implementation that keeps count of its clones and panics if any clones were leaked.

This is similar in use cases to the waker-fn crate, and trades away the alloc dependency, paying with the possibility of panicking at a leak. Panicking at termination is particularly not an issue when tasks never return anyway.

This could conceivably be taken out of riot-wrappers into a standalone crate – but then DropGuard needs to be generalized.


Build a core::task::Waker from the callback (which gets called whenever the waker is woken), and pass it into the main function.

Like with_counted_waker, but relying on main to never return anyway, there is no need to count.