1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! [`Decoder`]: per-(source, semantic) conversion from a payload into
//! [`Value`](crate::encoding::Value), plus every built-in decoder unit
//! type the crate ships.
use DecodeError;
use WireSource;
use crateValue;
/// Converts a per-column payload into a [`Value`].
///
/// Zero-sized unit-struct implementations (the crate's built-ins) cover
/// the common cases. User-defined stateful decoders carry their own
/// fields (lookup tables, compiled regexes, per-adapter configuration)
/// and implement the same trait shape.
// ------------------------------------------------------------------
// Built-in decoder unit types. Every one is a zero-sized marker whose
// `impl Decoder<Src, S, B>` for each supported `Src` lives in the format
// module (`pg_walstream`, `wal2json`, `maxwell`).
// ------------------------------------------------------------------
/// 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.
;
/// Decoder for boolean columns.
;
/// Decoder for integer columns fitting in `i64`.
;
/// 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.
;
/// Decoder for floating-point columns.
;
/// Decoder for text-affinity columns.
;
/// Decoder for pg_walstream binary-mode BYTEA.
;
/// Decoder for pg_walstream text-mode BYTEA (`\xHEX` form).
;
/// Decoder for MySQL binary-family columns (base64 on the wire).
;
/// Decoder rendering UUID wire text into a 16-byte `Value::Blob`.
;
/// Decoder rendering UUID wire text into a verbatim `Value::Text(36)`.
;
/// Decoder for `numeric`/`decimal` columns, storing Postgres's `numeric`
/// text (`-5000.0000`, `NaN`) as `Value::Text`.
;
/// Decoder for `timestamp` (without time zone), storing
/// `YYYY-MM-DD HH:MM:SS.ffffff` as `Value::Text`.
;
/// 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.
;
/// Decoder for `date`, storing `YYYY-MM-DD` as `Value::Text`.
;
/// Decoder for `time`, storing `HH:MM:SS.ffffff`, and for `timetz`,
/// storing the UTC time `HH:MM:SS.ffffff+00:00`.
;
/// Decoder for `interval`, storing the ISO 8601 duration Postgres prints
/// under `IntervalStyle = iso_8601`, such as `P1Y2M3DT4H5M6.789S`.
;
/// Decoder for `json`/`jsonb`. Preserves the wire form verbatim as
/// `Value::Text`.
;
/// Decoder for `json`/`jsonb` that canonicalizes into sorted-key compact
/// JSON text.
;