(
Extension(plugin): Extension<Plugin<PluginState>>,
)
| 33 | ) |
| 34 | )] |
| 35 | pub async fn list_methods( |
| 36 | Extension(plugin): Extension<Plugin<PluginState>>, |
| 37 | ) -> Result<Html<String>, AppError> { |
| 38 | match call_rpc(&plugin, "help", json!(HelpRequest { command: None })).await { |
| 39 | Ok(help_response) => { |
| 40 | let html_content = process_help_response(help_response); |
| 41 | Ok(Html(html_content)) |
| 42 | } |
| 43 | Err(err) => Err(AppError::InternalServerError(RpcError { |
| 44 | code: None, |
| 45 | data: None, |
| 46 | message: format!("Error calling help rpc: {}", err), |
| 47 | })), |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | fn process_help_response(help_response: serde_json::Value) -> String { |
| 52 | /* Parse the "help" field as an array of HelpCommand */ |
nothing calls this directly
no test coverage detected