pub trait ValueDecode: Sized + 'static {
const DECODE: &'static ValueDecodeSpec;
const METADATA: &'static [ValueMetadata] = _;
}Expand description
Describes the encoded representation, independently of reflection and memory layout. A handwritten encoder can delegate to the type it actually writes:
use cu_bincode::{ValueDecode, ValueDecodeSpec};
struct Orientation([f32; 4]);
impl ValueDecode for Orientation {
const DECODE: &'static ValueDecodeSpec = <[f32; 4] as ValueDecode>::DECODE;
}Required Associated Constants§
Sourceconst DECODE: &'static ValueDecodeSpec
const DECODE: &'static ValueDecodeSpec
Complete wire recipe for this encoding.
Provided Associated Constants§
Sourceconst METADATA: &'static [ValueMetadata] = _
const METADATA: &'static [ValueMetadata] = _
Static logical metadata retained alongside the wire recipe.
Metadata is borrowed from the image and never changes payload encoding. Copper owns the typed metadata vocabulary.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".