MCPcopy Create free account
hub / github.com/deviceplug/btleplug / poll

Method poll

src/corebluetooth/future.rs:104–113  ·  view source on GitHub ↗

Returns when the [BtlePlugMessageUnion] reply has been set in the [BtlePlugFutureStateShared].

(self: Pin<&mut Self>, cx: &mut Context)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 1

takeMethod · 0.80

Tested by

no test coverage detected