Module builder

Module builder 

Source

Macrosยง

variant_append_value ๐Ÿ”’
Macro to generate the match statement for each append_variant, try_append_variant, and append_variant_bytes โ€“ they each have slightly different handling for object and list handling.

Structsยง

ListBuilder
A builder for creating Variant::List values.
ListState
Internal state for list building
ObjectBuilder
A builder for creating Variant::Object values.
ObjectFieldBuilder
A VariantBuilderExt that inserts a new field into a variant object.
ObjectState
Internal state for object building
ParentState
Tracks information needed to correctly finalize a nested builder.
ReadOnlyMetadataBuilder
A metadata builder that cannot register new field names, and merely returns the field id associated with a known field name. This is useful for variant unshredding operations, where the metadata column is fixed and โ€“ per variant shredding spec โ€“ already contains all field names from the typed_value column. It is also useful when projecting a subset of fields from a variant object value, since the bytes can be copied across directly without re-encoding their field ids.
ValueBuilder
Wrapper around a Vec<u8> that provides methods for appending primitive values, variant types, and metadata.
VariantBuilder
Top level builder for Variant values
WritableMetadataBuilder
Builder for constructing metadata for Variant values.

Constantsยง

BASIC_TYPE_BITS ๐Ÿ”’
UNIX_EPOCH_DATE ๐Ÿ”’

Traitsยง

BuilderSpecificState
A trait for managing state specific to different builder types.
MetadataBuilder
A trait for building variant metadata dictionaries, to be used in conjunction with a ValueBuilder. The trait provides methods for managing field names and their IDs, as well as rolling back a failed builder operation that might have created new field ids.
VariantBuilderExt
Extends VariantBuilder to help building nested Variants

Functionsยง

append_packed_u32 ๐Ÿ”’
Append value_size bytes of given value into dest.
array_header ๐Ÿ”’
int_size ๐Ÿ”’
object_header ๐Ÿ”’
primitive_header ๐Ÿ”’
short_string_header ๐Ÿ”’
write_offset ๐Ÿ”’
Write little-endian integer to buffer
write_offset_at_pos ๐Ÿ”’
Write little-endian integer to buffer at a specific position