pub trait AnyValue: AnyValueTypeless {
// Required method
fn value_typeid(&self) -> TypeId;
// Provided methods
fn downcast_ref<T: 'static>(&self) -> Option<&T> { ... }
fn downcast<T: 'static>(self) -> Option<T>
where Self: Sized { ... }
}Expand description
Type erased value interface.
Know it’s type and size, possibly compile-time.
Required Methods§
fn value_typeid(&self) -> TypeId
Provided Methods§
fn downcast_ref<T: 'static>(&self) -> Option<&T>
fn downcast<T: 'static>(self) -> Option<T>where
Self: Sized,
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.