Skip to main content

ObjectValue

Trait ObjectValue 

Source
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§

Source

const PSEUDO_TYPE: StructType<'static>

The associated “pseudo-struct” type for the object value.

Required Associated Types§

Source

type FieldTypes<'a>: FieldTypes

The object value types as field types.

Source

type In<'a>

The type that is used when inputting object values to functions.

Source

type Out<'a>

The type that is used in function return values.

Required Methods§

Source

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Encode each part of the value in reverse order.

Source

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".

Implementations on Foreign Types§

Source§

impl ObjectValue for ()

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = ()

Source§

type In<'a> = ()

Source§

type Out<'a> = ()

Source§

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>

Source§

impl<A: ObjectFieldValue, B: ObjectFieldValue, C: ObjectFieldValue, D: ObjectFieldValue> ObjectValue for (A, B, C, D)

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<B as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<C as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<D as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type)

Source§

type In<'a> = (<A as ObjectFieldValue>::In<'a>, <B as ObjectFieldValue>::In<'a>, <C as ObjectFieldValue>::In<'a>, <D as ObjectFieldValue>::In<'a>)

Source§

type Out<'a> = (<A as ObjectFieldValue>::Out<'a>, <B as ObjectFieldValue>::Out<'a>, <C as ObjectFieldValue>::Out<'a>, <D as ObjectFieldValue>::Out<'a>)

Source§

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>

Source§

impl<A: ObjectFieldValue, B: ObjectFieldValue, C: ObjectFieldValue> ObjectValue for (A, B, C)

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<B as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<C as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type)

Source§

type In<'a> = (<A as ObjectFieldValue>::In<'a>, <B as ObjectFieldValue>::In<'a>, <C as ObjectFieldValue>::In<'a>)

Source§

type Out<'a> = (<A as ObjectFieldValue>::Out<'a>, <B as ObjectFieldValue>::Out<'a>, <C as ObjectFieldValue>::Out<'a>)

Source§

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>

Source§

impl<A: ObjectFieldValue, B: ObjectFieldValue> ObjectValue for (A, B)

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type, <<B as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type)

Source§

type In<'a> = (<A as ObjectFieldValue>::In<'a>, <B as ObjectFieldValue>::In<'a>)

Source§

type Out<'a> = (<A as ObjectFieldValue>::Out<'a>, <B as ObjectFieldValue>::Out<'a>)

Source§

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>

Source§

impl<A: ObjectFieldValue> ObjectValue for (A,)

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type,)

Source§

type In<'a> = (<A as ObjectFieldValue>::In<'a>,)

Source§

type Out<'a> = (<A as ObjectFieldValue>::Out<'a>,)

Source§

fn encode<'a>( value: &Self::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>

Source§

fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>

Implementors§

Source§

impl<A: ObjectFieldValue> ObjectValue for A

Source§

const PSEUDO_TYPE: StructType<'static>

Source§

type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type,)

Source§

type In<'a> = <A as ObjectFieldValue>::In<'a>

Source§

type Out<'a> = <A as ObjectFieldValue>::Out<'a>