Helper trait to access the thread from a task.
| 172 | |
| 173 | /// Helper trait to access the thread from a task. |
| 174 | pub trait AsThread { |
| 175 | /// Try to get the thread from the task. |
| 176 | fn try_as_thread(&self) -> Option<&Thread>; |
| 177 | |
| 178 | /// Get the thread from the task, panicking if it is a kernel task. |
| 179 | fn as_thread(&self) -> &Thread { |
| 180 | self.try_as_thread().expect("kernel task") |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | impl AsThread for TaskInner { |
| 185 | fn try_as_thread(&self) -> Option<&Thread> { |
no outgoing calls
no test coverage detected