pub trait Serializable<const N: usize> {
type Error;
const SIZE: usize = N;
// Required methods
fn from_bytes(buf: &[u8; N]) -> Result<Self, Self::Error>
where Self: Sized;
fn to_bytes(&self) -> [u8; N];
}Expand description
The core trait used to implement [from_bytes] and [to_bytes]
Provided Associated Constants§
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".