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

Method async_exec

std/src/console/cmds.rs:244–272  ·  view source on GitHub ↗
(&self, scope: Scope<'_>)

Source from the content-addressed store, hash-verified

242 }
243
244 async fn async_exec(&self, scope: Scope<'_>) -> CallResult<()> {
245 debug_assert_eq!(0, scope.nargs());
246
247 let key = self.console.borrow_mut().poll_key().await?;
248 let key_name = match key {
249 Some(Key::ArrowDown) => "DOWN".to_owned(),
250 Some(Key::ArrowLeft) => "LEFT".to_owned(),
251 Some(Key::ArrowRight) => "RIGHT".to_owned(),
252 Some(Key::ArrowUp) => "UP".to_owned(),
253
254 Some(Key::Backspace) => "BS".to_owned(),
255 Some(Key::CarriageReturn) => "ENTER".to_owned(),
256 Some(Key::Char(x)) => format!("{}", x),
257 Some(Key::Delete) => "DEL".to_owned(),
258 Some(Key::End) => "END".to_owned(),
259 Some(Key::EofOrDelete) => "EOF".to_owned(),
260 Some(Key::Escape) => "ESC".to_owned(),
261 Some(Key::Home) => "HOME".to_owned(),
262 Some(Key::Interrupt) => "INT".to_owned(),
263 Some(Key::NewLine) => "ENTER".to_owned(),
264 Some(Key::PageDown) => "PGDOWN".to_owned(),
265 Some(Key::PageUp) => "PGUP".to_owned(),
266 Some(Key::Tab) => "TAB".to_owned(),
267 Some(Key::Unknown) => "?".to_owned(),
268
269 None => "".to_owned(),
270 };
271 scope.return_string(key_name)
272 }
273}
274
275/// The `INPUT` command.

Callers

nothing calls this directly

Calls 15

read_lineFunction · 0.85
parse_booleanFunction · 0.85
parse_doubleFunction · 0.85
parse_integerFunction · 0.85
return_stringMethod · 0.80
nargsMethod · 0.80
get_typeMethod · 0.80
get_stringMethod · 0.80
push_strMethod · 0.80
get_mut_refMethod · 0.80
set_booleanMethod · 0.80
set_doubleMethod · 0.80

Tested by

no test coverage detected