Skip to main content

make_waker

Function make_waker 

Source
pub unsafe fn make_waker(state: *const CWakeState) -> Waker
Expand description

Build a Waker that calls state.fn_ptr(state.ctx) on wake.

§Safety

  • state must point to a valid CWakeState.
  • state must remain at the same address for as long as the returned Waker (and any clones a backend stashes) lives.
  • If a backend dispatches wakes from another thread, state’s ctx must be safe to read from that thread (see CWakeState Send / Sync discussion).