mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-29 22:58:59 +00:00
handle_async_api_request: put rpcenv into a Box
So that we can pass rpcenv into futures.
This commit is contained in:
parent
d5901112de
commit
3bbbece6a2
@ -264,7 +264,7 @@ pub fn handle_sync_api_request<Env: RpcEnvironment>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_async_api_request<Env: RpcEnvironment>(
|
pub fn handle_async_api_request<Env: RpcEnvironment>(
|
||||||
mut rpcenv: Env,
|
rpcenv: Env,
|
||||||
info: &'static ApiAsyncMethod,
|
info: &'static ApiAsyncMethod,
|
||||||
formatter: &'static OutputFormatter,
|
formatter: &'static OutputFormatter,
|
||||||
parts: Parts,
|
parts: Parts,
|
||||||
@ -294,7 +294,7 @@ pub fn handle_async_api_request<Env: RpcEnvironment>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match (info.handler)(parts, req_body, params, info, &mut rpcenv) {
|
match (info.handler)(parts, req_body, params, info, Box::new(rpcenv)) {
|
||||||
Ok(future) => future,
|
Ok(future) => future,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let resp = (formatter.format_error)(Error::from(err));
|
let resp = (formatter.format_error)(Error::from(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user