(&self, scope: Scope<'_>)
| 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`. |
nothing calls this directly
no test coverage detected