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
| Attribute | Type | Description |
|---|---|---|
| serializers | Vec< Arc< CombinedSerializer > > | A collection of serializers used to process each corresponding element within the tuple. |
| variadic_item_index | Option< usize > | The index position of the variadic element within the tuple, used to handle variable-length sequences. |
| filter | SchemaFilter< usize > | A schema filter applied to specific indices to determine which tuple elements should be included or excluded during serialization. |
| name | String | The 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
| Name | Type | Description |
|---|---|---|
| serializers | List[CombinedSerializer] | A list of serializers for each element in the tuple. |
| variadic_item_index | Optional[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. |
| name | str | The 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
| Name | Type | Description |
|---|---|---|
| serializers | Vec< Arc< CombinedSerializer > > | A collection of serializers used to process each corresponding element in the tuple. |
| variadic_item_index | Option< usize > | The index within the tuple where variadic (arbitrary length) items begin, if applicable. |
| filter | SchemaFilter< usize > | A filter used to include or exclude specific tuple indices during the serialization process. |
| name | String | The identifier name for this tuple schema, used in error reporting and metadata. |