Skip to main content

Module decode

Module decode 

Source

Modulesยง

public_decoders

Structsยง

AvroFieldAccess
DecodeDepthGuard ๐Ÿ”’
GeneralDeserializer
ResolvedRecordAccess ๐Ÿ”’
SimpleArrayAccess ๐Ÿ”’
SimpleMapAccess
SimpleRecordAccess ๐Ÿ”’
ValueArrayAccess ๐Ÿ”’
ValueMapAccess ๐Ÿ”’
ValueRecordAccess ๐Ÿ”’

Enumsยง

SchemaOrDefault ๐Ÿ”’
ValueOrReader

Constantsยง

DECODE_DEPTH ๐Ÿ”’
DECODE_NODES ๐Ÿ”’
Cumulative Value nodes decoded so far in the current top-level decode, shared by every array and map in the datum and bounded by MAX_VALUE_NODES. Reset to 0 at each top-level entry (see DecodeDepthGuard::enter) so the budget composes across nesting instead of resetting per collection. Charged via charge_value_nodes.
MAX_DECODE_DEPTH ๐Ÿ”’
Cap on recursive GeneralDeserializer::deserialize calls. Avro records may reference themselves ({"name":"X","type":"record","fields":[ {"name":"x","type":"X"}]}), so a malicious file plus matching wire bytes can recurse forever and overflow the stack.
MAX_VALUE_NODES ๐Ÿ”’
Sanity cap on the number of Value nodes one top-level decode may materialize across every array and map in the datum. Arrays and maps apply it per block (a fast reject for an absurd single-block count) and against the shared cumulative budget threaded through the whole decode (see charge_value_nodes / DECODE_NODES).

Traitsยง

AvroArrayAccess
AvroDecodable
AvroDecode
AvroDeserializer
AvroMapAccess
AvroRead
A convenience trait for types that are both readable and skippable.
AvroRecordAccess
Skip
A trait that allows for efficient skipping forward while reading data.
StatefulAvroDecodable

Functionsยง

build_ts_value
A convenience function to build timestamp values from underlying longs.
charge_value_nodes ๐Ÿ”’
Charges nodes against the per-datum DECODE_NODES budget shared by every array and map in a single top-level decode, rejecting once the cumulative total exceeds MAX_VALUE_NODES. kind ("array" / "map") only labels the error.
decode
Decode a Value from avro format given its Schema.
decode_double ๐Ÿ”’
decode_float ๐Ÿ”’
decode_int_nonneg ๐Ÿ”’
decode_len ๐Ÿ”’
decode_long_nonneg ๐Ÿ”’
give_value
min_encoded_len ๐Ÿ”’
A lower bound on the number of bytes any value of schema encodes to on the wire.
min_encoded_len_or_named ๐Ÿ”’
Resolves a (possibly named) schema reference, guarding against named-type cycles, then defers to min_encoded_len_piece.
min_encoded_len_piece ๐Ÿ”’
min_value_nodes ๐Ÿ”’
A lower bound on the number of Value nodes a single value of schema materializes into when decoded.
min_value_nodes_or_named ๐Ÿ”’
Resolves a (possibly named) schema reference, guarding against named-type cycles, then defers to min_value_nodes_piece.
min_value_nodes_piece ๐Ÿ”’