(&mut self)
| 82 | P: Pull<Message<T, D>> + 'static, |
| 83 | { |
| 84 | fn accept_input(&mut self) { |
| 85 | let mut queue = self.queue.borrow_mut(); |
| 86 | let mut new_data = false; |
| 87 | self.handle.for_each(|cap, data| { |
| 88 | new_data = true; |
| 89 | let cap = self.connection.accept(cap); |
| 90 | queue.push_back(Event::Data(cap, std::mem::take(data))); |
| 91 | }); |
| 92 | if new_data { |
| 93 | if let Some(waker) = self.waker.take() { |
| 94 | waker.wake(); |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | fn drain_input(&mut self) { |
| 100 | self.queue.borrow_mut().clear(); |