pub trait AnyAtom: Atom {
// Required methods
fn from_any(any: Any) -> Option<Self>;
fn from_any_ref(any: &Any) -> Option<&Self>;
fn from_any_mut(any: &mut Any) -> Option<&mut Self>;
fn into_any(self) -> Any;
}Expand description
A trait to help casting to/from Any. From/TryFrom use concrete types, but if we want to use generics, then we need a trait.
Required Methods§
fn from_any(any: Any) -> Option<Self>
fn from_any_ref(any: &Any) -> Option<&Self>
fn from_any_mut(any: &mut Any) -> Option<&mut Self>
fn into_any(self) -> Any
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.