pub trait TypedEnum{
// Required methods
fn try_from_type(
type_id: TypeId,
data: &dyn Any,
) -> Result<Self, UnknownTypeError>;
fn get_type(&self) -> TypeId;
fn get_payload(&self) -> Vec<u8> ⓘ;
fn serialize(&self) -> Vec<u8> ⓘ;
}Required Methods§
fn try_from_type( type_id: TypeId, data: &dyn Any, ) -> Result<Self, UnknownTypeError>
fn get_type(&self) -> TypeId
fn get_payload(&self) -> Vec<u8> ⓘ
fn serialize(&self) -> Vec<u8> ⓘ
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.