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

Method async_exec

std/src/help.rs:497–523  ·  view source on GitHub ↗
(&self, scope: Scope<'_>)

Source from the content-addressed store, hash-verified

495 }
496
497 async fn async_exec(&self, scope: Scope<'_>) -> CallResult<()> {
498 let topics = Topics::new(&self.callables.borrow());
499
500 if scope.nargs() == 0 {
501 let mut console = self.console.borrow_mut();
502 let result = {
503 let mut pager =
504 Pager::new(&mut *console, self.yielder.clone()).map_err(CallError::from)?;
505 self.summary(&topics, &mut pager).await
506 };
507 result.map_err(CallError::from)?;
508 } else {
509 debug_assert_eq!(1, scope.nargs());
510 let t = scope.get_string(0).to_owned();
511
512 let topic = topics.find(&t, &scope, 0)?;
513 let mut console = self.console.borrow_mut();
514 let result = {
515 let mut pager =
516 Pager::new(&mut *console, self.yielder.clone()).map_err(CallError::from)?;
517 topic.describe(&mut pager).await
518 };
519 result.map_err(CallError::from)?;
520 }
521
522 Ok(())
523 }
524}
525
526/// Adds all help-related commands to the `machine` and makes them write to `console`.

Callers

nothing calls this directly

Calls 5

nargsMethod · 0.80
summaryMethod · 0.80
get_stringMethod · 0.80
findMethod · 0.80
describeMethod · 0.45

Tested by

no test coverage detected