router: AsAny: add as_any_mut
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
f78c28dd11
commit
41b08323a7
@ -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<T: Any + Send> 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
|
||||
|
Loading…
Reference in New Issue
Block a user