pub trait Representation<V> {
const BOUNDARY: usize;
// Required methods
fn encode_value(value: &V, writer: &mut ByteWriter<'_>);
fn decode_value(reader: &mut ByteReader<'_>) -> Result<V, DecoderError>;
// Provided method
fn encoded_len_of(value: &V) -> usize { ... }
}Expand description
An encoding marker: Self names the HLA datatype used to carry Rust values of type V.
Every Decode type represents itself. In addition the basic wrappers represent their native type
(HLAinteger32BE represents i32, HLAunicodeString represents String…), which lets the record
macros keep plain Rust field types: count: i32 as HLAinteger32BE.
Required Associated Constants§
Required Methods§
Sourcefn encode_value(value: &V, writer: &mut ByteWriter<'_>)
fn encode_value(value: &V, writer: &mut ByteWriter<'_>)
Encodes value as this datatype.
Sourcefn decode_value(reader: &mut ByteReader<'_>) -> Result<V, DecoderError>
fn decode_value(reader: &mut ByteReader<'_>) -> Result<V, DecoderError>
Decodes a value of this datatype.
Provided Methods§
Sourcefn encoded_len_of(value: &V) -> usize
fn encoded_len_of(value: &V) -> usize
Encoded length of value when it starts at an aligned offset.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".