manual_executor/
task_wake.rs

1use crate::{Key, ManualExecutor};
2use std::{sync::Arc, task::Wake};
3
4pub(crate) struct TaskWake {
5  executor: Arc<ManualExecutor>,
6  key: Key,
7}
8
9impl TaskWake {
10  pub fn new(executor: Arc<ManualExecutor>, key: Key) -> Arc<Self> {
11    Arc::new(Self { executor, key })
12  }
13}
14
15impl Wake for TaskWake {
16  fn wake(self: Arc<Self>) {
17    self.executor.clone().wake(self.key)
18  }
19}