Returns when the [BtlePlugMessageUnion] reply has been set in the [BtlePlugFutureStateShared].
(self: Pin<&mut Self>, cx: &mut Context)
| 102 | /// Returns when the [BtlePlugMessageUnion] reply has been set in the |
| 103 | /// [BtlePlugFutureStateShared]. |
| 104 | fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> { |
| 105 | let mut waker_state = self.waker_state.lock().unwrap(); |
| 106 | if waker_state.reply_msg.is_some() { |
| 107 | let msg = waker_state.reply_msg.take().unwrap(); |
| 108 | Poll::Ready(msg) |
| 109 | } else { |
| 110 | waker_state.waker = Some(cx.waker().clone()); |
| 111 | Poll::Pending |
| 112 | } |
| 113 | } |
| 114 | } |