pub trait DataType: Sized {
const META: StructFieldMeta;
// Provided methods
fn encode_usize(buf: &mut BufWriter<'_>, value: usize) { ... }
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError> { ... }
}
Expand description
All data types must implement this trait. This allows for encoding and decoding of the data type to byte buffers.
Required Associated Constants§
const META: StructFieldMeta
Provided Methods§
fn encode_usize(buf: &mut BufWriter<'_>, value: usize)
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError>
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.