Embassy
embassy-executor

Crates

git

Versions

std

Flavors

Function embassy_executor::raw::task_from_waker

source ·
pub fn task_from_waker(waker: &Waker) -> TaskRef
Expand description

Get a task pointer from a waker.

This can be used as an optimization in wait queues to store task pointers (1 word) instead of full Wakers (2 words). This saves a bit of RAM and helps avoid dynamic dispatch.

You can use the returned task pointer to wake the task with wake_task.

§Panics

Panics if the waker is not created by the Embassy executor.