api_schema: allow generic api handler functions

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2019-04-16 10:36:04 +02:00
parent 286f0d4099
commit 062d4916ff
13 changed files with 176 additions and 26 deletions

View File

@ -239,7 +239,7 @@ fn handle_sync_api_request(
let resp = params
.and_then(move |params| {
let mut delay = false;
let resp = match (info.handler)(params, info, &mut rpcenv) {
let resp = match (info.handler.as_ref().unwrap())(params, info, &mut rpcenv) {
Ok(data) => (formatter.format_result)(data, &rpcenv),
Err(err) => {
if let Some(httperr) = err.downcast_ref::<HttpError>() {