From 41b08323a7147c0118cfeb8a5ab15967a1e2dbbd Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 13 Jun 2024 14:13:07 +0200 Subject: [PATCH] router: AsAny: add as_any_mut Signed-off-by: Wolfgang Bumiller --- proxmox-router/src/rpc_environment.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxmox-router/src/rpc_environment.rs b/proxmox-router/src/rpc_environment.rs index 476c0d41..8ce2d99d 100644 --- a/proxmox-router/src/rpc_environment.rs +++ b/proxmox-router/src/rpc_environment.rs @@ -5,12 +5,17 @@ use serde_json::Value; /// Helper to get around `RpcEnvironment: Sized` pub trait AsAny { fn as_any(&self) -> &(dyn Any + Send); + fn as_any_mut(&mut self) -> &mut (dyn Any + Send); } impl AsAny for T { fn as_any(&self) -> &(dyn Any + Send) { self } + + fn as_any_mut(&mut self) -> &mut (dyn Any + Send) { + self + } } /// Abstract Interface for API methods to interact with the environment