Causes the future with the specified ID to be polled
(&mut self, future_id: u64)
| 360 | /// Causes the future with the specified ID to be polled |
| 361 | /// |
| 362 | fn poll_future(&mut self, future_id: u64) { |
| 363 | if let Some(future) = self.futures.get_mut(&future_id) { |
| 364 | // Create a context to poll this future in |
| 365 | let glutin_waker = GlutinFutureWaker { future_id: Mutex::new(Some(future_id)) }; |
| 366 | let glutin_waker = task::waker(Arc::new(glutin_waker)); |
| 367 | let mut glutin_context = task::Context::from_waker(&glutin_waker); |
| 368 | |
| 369 | // Poll the future |
| 370 | let poll_result = future.poll_unpin(&mut glutin_context); |
| 371 | |
| 372 | // Remove the future from the list if it has completed |
| 373 | if let task::Poll::Ready(_) = poll_result { |
| 374 | self.futures.remove(&future_id); |
| 375 | } |
| 376 | } |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | impl task::ArcWake for GlutinFutureWaker { |
no outgoing calls
no test coverage detected