pub trait Serializable {
const IS_FIXED_SIZE: bool;
// Required methods
fn serialize(&self) -> Cow<'_, [u8]>;
fn serialize_fixed_size(&self) -> Option<[u8; 8]>;
}Expand description
Trait for serializing a type to a byte slice or a fixed size byte array.
Required Associated Constants§
const IS_FIXED_SIZE: bool
Required Methods§
Sourcefn serialize_fixed_size(&self) -> Option<[u8; 8]>
fn serialize_fixed_size(&self) -> Option<[u8; 8]>
May return None if the type is not fixed size representable.
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.