pub trait TypedContainer {
// Required method
fn type_id(&self) -> TypeId;
// Provided method
fn holds<T>(&self) -> bool
where T: 'static { ... }
}Expand description
A trait for types that can hold values of different types.
Required Methods§
Sourcefn type_id(&self) -> TypeId
fn type_id(&self) -> TypeId
Returns the std::any::TypeId of the contained value.
Provided Methods§
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.