Crate matchy_data_format

Crate matchy_data_format 

Source
Expand description

Data section encoding and decoding for Paraglob v2

Provides full MMDB-compatible data encoding for storing pattern-associated data. Implements the complete MaxMind DB data type specification.

§Supported Types

Complete MMDB type support:

  • Pointer: Reference to another data item (with base handling)
  • String: UTF-8 text data
  • Double: 64-bit floating point (IEEE 754)
  • Bytes: Raw byte arrays
  • Uint16: Unsigned 16-bit integers
  • Uint32: Unsigned 32-bit integers
  • Map: Key-value pairs (string keys)
  • Int32: Signed 32-bit integers
  • Uint64: Unsigned 64-bit integers
  • Uint128: Unsigned 128-bit integers
  • Array: Ordered lists of values
  • Bool: Boolean values
  • Float: 32-bit floating point (IEEE 754)

§Format

Uses MMDB encoding: control byte(s) followed by data. Control byte encodes type (3 bits) and size/payload (5 bits).

See: https://maxmind.github.io/MaxMind-DB/

Structs§

DataDecoder
Data section decoder
DataEncoder
Data section encoder
DataFormatStats
Statistics from data format validation
DataFormatValidationResult
Validation result for data format checks
PointerValidationResult
Result of MMDB data section pointer validation
PointerValidationStats
Statistics from pointer validation

Enums§

DataValue
Data value that can be stored in the data section
PointerValidationError
Validation error types for MMDB data section pointer chains

Constants§

MAX_POINTER_DEPTH
Maximum safe depth for pointer chains in MMDB data
MAX_TOTAL_DEPTH
Maximum reasonable total nesting depth (arrays/maps + pointers)

Functions§

validate_data_section
Validate data section structure by attempting to decode values
validate_data_value_pointers
Validate a data value and all pointers it contains
validate_data_value_utf8
Validate UTF-8 in a decoded data value at the given offset
validate_value_strings_utf8
Recursively validate UTF-8 in all strings within a DataValue