Skip to main content

TupleSerializer

This class provides functionality for serializing tuple structures by managing a collection of individual item serializers. It supports variadic items through a specific index tracking mechanism and includes filtering capabilities to control which elements are processed during serialization.

Attributes

AttributeTypeDescription
serializersVec< Arc< CombinedSerializer > >A collection of serializers used to process each corresponding element within the tuple.
variadic_item_indexOption< usize >The index position of the variadic element within the tuple, used to handle variable-length sequences.
filterSchemaFilter< usize >A schema filter applied to specific indices to determine which tuple elements should be included or excluded during serialization.
nameStringThe identifier string used to represent the tuple type in error messages and schema definitions.

Constructor

Signature

def TupleSerializer(
serializers: List[CombinedSerializer],
variadic_item_index: Optional[int],
filter: [SchemaFilter](../../../filter/schemafilter.md?sid=serializers_filter_schemafilter),
name: str
) - > null

Parameters

NameTypeDescription
serializersList[CombinedSerializer]A list of serializers for each element in the tuple.
variadic_item_indexOptional[int]The index at which the variadic (arbitrary length) part of the tuple begins, if applicable.
filter[SchemaFilter](../../../filter/schemafilter.md?sid=serializers_filter_schemafilter)A filter used to include or exclude specific tuple elements during serialization.
namestrThe name identifier for the tuple schema.

Signature

@staticmethod
def new(
serializers: Vec< Arc< CombinedSerializer > >,
variadic_item_index: Option< usize >,
filter: SchemaFilter< usize >,
name: String
) - > [TupleSerializer](tupleserializer.md?sid=serializers_type_serializers_tuple_tupleserializer)

Parameters

NameTypeDescription
serializersVec< Arc< CombinedSerializer > >A collection of serializers used to process each corresponding element in the tuple.
variadic_item_indexOption< usize >The index within the tuple where variadic (arbitrary length) items begin, if applicable.
filterSchemaFilter< usize >A filter used to include or exclude specific tuple indices during the serialization process.
nameStringThe identifier name for this tuple schema, used in error reporting and metadata.