pub trait Erasable: Copy {
type Storage: Copy;
}Expand description
Trait for types that can be erased into Erased<Self>.
Erasing and unerasing values is performed by erase_val and restore_val.
FIXME: This whole trait could potentially be replaced by T: Copy and the
storage type [u8; size_of::<T>()] when support for that is more mature.
Required Associated Types§
Sourcetype Storage: Copy
type Storage: Copy
Storage type to used for erased values of this type.
Should be [u8; N], where N is equal to size_of::<Self>.
ErasedData wraps this storage type in MaybeUninit to ensure that
transmutes to/from erased storage are well-defined.
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.