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.
DateDecoder
Decoder for date, storing YYYY-MM-DD as Value::Text.
DecimalTextDecoder
Decoder for numeric/decimal columns, storing Postgres’s numeric text (-5000.0000, NaN) 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.
IntervalDecoder
Decoder for interval, storing the ISO 8601 duration Postgres prints under IntervalStyle = iso_8601, such as P1Y2M3DT4H5M6.789S.
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.
TimeDecoder
Decoder for time, storing HH:MM:SS.ffffff, and for timetz, storing the UTC time HH:MM:SS.ffffff+00:00.
TimestampDecoder
Decoder for timestamp (without time zone), storing YYYY-MM-DD HH:MM:SS.ffffff as Value::Text.
TimestampTzDecoder
Decoder for timestamptz, storing the instant in UTC as YYYY-MM-DD HH:MM:SS.ffffff+00:00, which orders as text and which SQLite’s date functions read.
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
Source-qualified table lookup for DiffSetBuilder::digest.
WireSource
Per-format marker naming a CDC wire source.