pub trait Byteable {
const SIZE: usize;
// Required methods
fn from_bytes(bytes: &[u8]) -> Self;
fn to_bytes(&self) -> Vec<u8> ⓘ;
// Provided method
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized { ... }
}Required Associated Constants§
Required Methods§
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.