• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::runtime::task::{self, Task};
2 
3 /// `task::Schedule` implementation that does nothing. This is unique to the
4 /// blocking scheduler as tasks scheduled are not really futures but blocking
5 /// operations.
6 ///
7 /// We avoid storing the task by forgetting it in `bind` and re-materializing it
8 /// in `release.
9 pub(crate) struct NoopSchedule;
10 
11 impl task::Schedule for NoopSchedule {
release(&self, _task: &Task<Self>) -> Option<Task<Self>>12     fn release(&self, _task: &Task<Self>) -> Option<Task<Self>> {
13         None
14     }
15 
schedule(&self, _task: task::Notified<Self>)16     fn schedule(&self, _task: task::Notified<Self>) {
17         unreachable!();
18     }
19 }
20