Skip to main content

WireSource

Trait WireSource 

Source
pub trait WireSource: Sealed {
    type Payload<'a>;

    // Required methods
    fn wire_type(payload: &Self::Payload<'_>) -> WireType;
    fn column_name<'a>(payload: &'a Self::Payload<'_>) -> &'a str;
}
Expand description

Per-format marker naming a CDC wire source.

Implementors are unit structs owned by each format module (PgWalstream, Wal2Json, Maxwell). The associated payload type describes the format’s per-column wire data.

Type identity is no longer source-native. Every payload carries a source-independent WireType that selects the decoder, so one semantic catalog drives every source without a per-source translation table.

Required Associated Types§

Source

type Payload<'a>

Per-column payload the format hands to a decoder.

Every payload struct carries a column_name: &'a str so decoder errors are self-describing without an outer wrapping layer.

Required Methods§

Source

fn wire_type(payload: &Self::Payload<'_>) -> WireType

Semantic type of the column carried by the payload, used for decoder dispatch.

Source

fn column_name<'a>(payload: &'a Self::Payload<'_>) -> &'a str

Extract the column name from a payload for diagnostic messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§