Create a Future that waits for the Pollable's readiness.
(&self)
| 40 | } |
| 41 | /// Create a Future that waits for the Pollable's readiness. |
| 42 | pub fn wait_for(&self) -> WaitFor { |
| 43 | use std::sync::atomic::{AtomicU64, Ordering}; |
| 44 | static COUNTER: AtomicU64 = AtomicU64::new(0); |
| 45 | let unique = COUNTER.fetch_add(1, Ordering::Relaxed); |
| 46 | WaitFor { |
| 47 | waitee: Waitee { |
| 48 | pollable: self.clone(), |
| 49 | unique, |
| 50 | }, |
| 51 | needs_deregistration: false, |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | #[derive(Debug, PartialEq, Eq, Hash, Clone)] |
no outgoing calls