MCPcopy Index your code
hub / github.com/endbasic/endbasic / try_recv

Method try_recv

web/src/input.rs:158–167  ·  view source on GitHub ↗

Gets the next key event, if one is available.

(&mut self)

Source from the content-addressed store, hash-verified

156
157 /// Gets the next key event, if one is available.
158 pub(crate) async fn try_recv(&mut self) -> io::Result<Option<Key>> {
159 match self.on_key_rx.try_recv() {
160 Ok(k) => {
161 self.yielder.on_host_yield();
162 Ok(Some(k))
163 }
164 Err(TryRecvError::Empty) => Ok(None),
165 Err(TryRecvError::Closed) => log_and_panic!("Channel unexpectedly closed"),
166 }
167 }
168
169 /// Gets the next key event, waiting until one is available.
170 pub(crate) async fn recv(&mut self) -> io::Result<Key> {

Callers 8

poll_keyMethod · 0.80
poll_keyMethod · 0.80
poll_keyMethod · 0.80
wait_one_signalMethod · 0.80
runFunction · 0.80
drain_signalsMethod · 0.80
should_stopMethod · 0.80
poll_keyMethod · 0.80

Calls 1

on_host_yieldMethod · 0.80

Tested by

no test coverage detected