mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-24 03:47:13 +00:00
15 lines
268 B
Rust
15 lines
268 B
Rust
use std::any::Any;
|
|
|
|
/// An easy way to convert types to Any
|
|
///
|
|
/// Mostly useful to downcast trait objects (see RpcEnvironment).
|
|
pub trait AsAny {
|
|
fn as_any(&self) -> &dyn Any;
|
|
}
|
|
|
|
impl<T: Any> AsAny for T {
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
}
|