(
Extension(plugin): Extension<Plugin<PluginState>>,
)
| 155 | ) |
| 156 | )] |
| 157 | pub async fn list_methods( |
| 158 | Extension(plugin): Extension<Plugin<PluginState>>, |
| 159 | ) -> Result<Html<String>, AppError> { |
| 160 | match call_rpc(&plugin, "help", json!(HelpRequest { command: None })).await { |
| 161 | Ok(help_response) => { |
| 162 | let html_content = process_help_response(help_response); |
| 163 | Ok(Html(html_content)) |
| 164 | } |
| 165 | Err(err) => Err(AppError::InternalServerError(RpcError { |
| 166 | code: None, |
| 167 | data: None, |
| 168 | message: format!("Error calling help rpc: {}", err), |
| 169 | })), |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | fn process_help_response(help_response: serde_json::Value) -> String { |
| 174 | /* Parse the "help" field as an array of HelpCommand */ |
nothing calls this directly
no test coverage detected