Skip to main content

WireSource

Trait WireSource 

Source
pub trait WireSource: Sealed {
    type Payload<'a>;
    type TypeKey: Hash + Eq + Clone;

    // Required methods
    fn type_key(payload: &Self::Payload<'_>) -> Self::TypeKey;
    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 types describe the format’s per-column payload and its native type-identity key.

§Type keys

  • PgWalstream::TypeKey = pg_walstream::Oid (u32 alias).
  • Wal2Json::TypeKey = alloc::sync::Arc<str> (Postgres type name).
  • Maxwell::TypeKey = alloc::sync::Arc<str> (MySQL type name; empty string when the Maxwell daemon runs without --include_types).

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.

Source

type TypeKey: Hash + Eq + Clone

Type identity as seen on this source’s wire.

Required Methods§

Source

fn type_key(payload: &Self::Payload<'_>) -> Self::TypeKey

Extract the type key from a payload for 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§