pub trait ObjectValue {
type FieldTypes<'a>: FieldTypes;
type In<'a>;
type Out<'a>;
const PSEUDO_TYPE: StructType<'static>;
// Required methods
fn encode<'a>(
value: &Self::In<'a>,
encoder: &mut dyn Encoder,
) -> Result<(), EncodeError>;
fn decode<'a>(
decoder: &mut dyn Decoder<'a>,
mem: &'a MemoryManager,
) -> Result<Self::Out<'a>, DecodeError>;
}Expand description
This trait is implemented for types that can be used as tuples of value fields in state objects.
Required Associated Constants§
Sourceconst PSEUDO_TYPE: StructType<'static>
const PSEUDO_TYPE: StructType<'static>
The associated “pseudo-struct” type for the object value.
Required Associated Types§
Sourcetype FieldTypes<'a>: FieldTypes
type FieldTypes<'a>: FieldTypes
The object value types as field types.
Required Methods§
Sourcefn encode<'a>(
value: &Self::In<'a>,
encoder: &mut dyn Encoder,
) -> Result<(), EncodeError>
fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>
Encode each part of the value in reverse order.
Sourcefn decode<'a>(
decoder: &mut dyn Decoder<'a>,
mem: &'a MemoryManager,
) -> Result<Self::Out<'a>, DecodeError>
fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>
Decode the value from the decoder.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".