crabka_replicator/record.rs
1//! The payload that travels through the connect runtime for one replicated record.
2
3use bytes::Bytes;
4
5/// One record from the source cluster, carried as the connect-value type `V`
6/// through the [`crabka_connect`] runtime.
7///
8/// Because [`crabka_connect::ConnectRecord`] has no topic/partition fields,
9/// all envelope metadata is bundled here alongside the raw payload.
10#[derive(Debug, Clone, PartialEq, Eq)]
11pub struct ReplicatedRecord {
12 /// The source topic name.
13 pub topic: String,
14 /// The source partition index.
15 pub partition: i32,
16 /// The source offset (0-based).
17 pub offset: i64,
18 /// Record timestamp in epoch milliseconds.
19 pub timestamp: i64,
20 /// Record key, or `None` for a null key.
21 pub key: Option<Bytes>,
22 /// Record value, or `None` for a tombstone.
23 pub value: Option<Bytes>,
24 /// Per-record headers in declaration order.
25 pub headers: Vec<(String, Option<Bytes>)>,
26}