Skip to main content

Module wire

Module wire 

Source
Expand description

Schema-aware forward conversion from CDC wire formats into Value.

Every supported wire source (pg_walstream, wal2json, maxwell) carries per-column type metadata alongside the raw value bytes. This module funnels the three sources through one shared decoding contract so users can register a single type-to-decoder mapping and consume multiple wire formats interchangeably.

§Shape

  • WireSource (sealed): per-source marker with an associated payload struct. Each payload carries a semantic WireType. Implemented by PgWalstream, Wal2Json, Maxwell.
  • Decoder: one implementation per (source, semantic) pair. Zero-sized unit types for stateless decoders (BoolDecoder, IntDecoder, …), state-carrying structs for user config.
  • WireAdapter: single-method dispatcher fed a per-column payload, returns a Value.
  • TypeMap: generic hashmap-backed WireAdapter implementation keyed by WireType. The primary user-facing type.
  • TypeMapDefaults: per-source defaults() builder for a TypeMap pre-populated with the crate’s self-evident mappings.

Structs§

BoolDecoder
Decoder for boolean columns.
DateVerbatimDecoder
Decoder for date. Preserves the wire text verbatim.
DecimalTextDecoder
Decoder for numeric/decimal columns, preserving precision as Value::Text.
Int64OverflowToTextDecoder
Decoder for integer columns whose wire values may exceed i64. Values fitting i64 produce Value::Integer, values above produce Value::Text with the base-10 digits preserved.
IntDecoder
Decoder for integer columns fitting in i64.
IntervalVerbatimDecoder
Decoder for interval. Preserves the wire text verbatim.
JsonCanonicalDecoder
Decoder for json/jsonb that canonicalizes into sorted-key compact JSON text.
JsonVerbatimDecoder
Decoder for json/jsonb. Preserves the wire form verbatim as Value::Text.
MySqlBinaryDecoder
Decoder for MySQL binary-family columns (base64 on the wire).
NullDecoder
Decoder producing Value::Null regardless of the payload’s non-null contents. Registered internally when the payload’s null discriminator is set. Users normally do not register this directly.
PgBinary
A value read back from an executed Postgres query in binary result format, tagged with the catalog’s semantic type for the column.
PgBinaryColumn
One binary result field for the PgBinary source.
PgByteaBinaryDecoder
Decoder for pg_walstream binary-mode BYTEA.
PgByteaTextModeDecoder
Decoder for pg_walstream text-mode BYTEA (\xHEX form).
RealDecoder
Decoder for floating-point columns.
TextDecoder
Decoder for text-affinity columns.
TimeVerbatimDecoder
Decoder for time/timetz. Preserves the wire text verbatim.
TimestampTzVerbatimDecoder
Decoder for timestamptz. Preserves the wire text verbatim.
TimestampVerbatimDecoder
Decoder for timestamp (without time zone). Preserves the wire text verbatim.
TypeMap
Generic type-to-decoder registry.
UuidBlob16Decoder
Decoder rendering UUID wire text into a 16-byte Value::Blob.
UuidText36Decoder
Decoder rendering UUID wire text into a verbatim Value::Text(36).

Enums§

DecodeError
Failure modes shared across every wire::Decoder implementation.
WireType
Semantic column type used to select a decoder, independent of any wire source’s native type identity.

Traits§

Decoder
Converts a per-column payload into a Value.
Digestable
One CDC wire event digested via DiffSetBuilder::digest.
TypeMapDefaults
Per-source companion trait providing a pre-populated TypeMap with every self-evident mapping the crate ships.
WireAdapter
Decodes one per-column payload into a Value.
WireColumnTypes
Schema-side semantic type for one column of one table.
WireSchema
Table-name lookup for the DiffSetBuilder::digest entry point.
WireSource
Per-format marker naming a CDC wire source.