diff options
Diffstat (limited to 'tokio/src/runtime/blocking/schedule.rs')
-rw-r--r-- | tokio/src/runtime/blocking/schedule.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tokio/src/runtime/blocking/schedule.rs b/tokio/src/runtime/blocking/schedule.rs new file mode 100644 index 00000000..461b12c3 --- /dev/null +++ b/tokio/src/runtime/blocking/schedule.rs @@ -0,0 +1,18 @@ +use crate::task::{Schedule, Task}; + +/// `task::Schedule` implementation that does nothing. This is unique to the +/// blocking scheduler as tasks scheduled are not really futures but blocking +/// operations. +pub(super) struct NoopSchedule; + +impl Schedule for NoopSchedule { + fn bind(&self, _task: &Task<Self>) {} + + fn release(&self, _task: Task<Self>) {} + + fn release_local(&self, _task: &Task<Self>) {} + + fn schedule(&self, _task: Task<Self>) { + unreachable!(); + } +} |