pub struct DatabaseEventBatch {
pub events: Vec<DatabaseEvent>,
pub source_id: Option<String>,
pub batch_seq: u64,
pub relations: Vec<RelationMeta>,
pub control_directive: Option<ControlDirective>,
pub sequence_values: Option<Vec<SequenceValue>>,
pub backfill_metadata: Option<BackfillMetadata>,
}Expand description
Batch of events for efficient transport.
Fields§
§events: Vec<DatabaseEvent>Events in this batch.
source_id: Option<String>Source identifier (proxy/connector ID).
batch_seq: u64Batch sequence number (for ordering/deduplication).
relations: Vec<RelationMeta>Cached relation metadata for this batch.
control_directive: Option<ControlDirective>Control directive for this batch (if a control batch). When present, this batch signals the receiver to perform an administrative operation rather than applying data changes.
sequence_values: Option<Vec<SequenceValue>>Sequence values for synchronization. Present when control_directive is SyncSequences.
backfill_metadata: Option<BackfillMetadata>Backfill metadata for progress tracking. Present when the batch contains a BackfillStart event.
Implementations§
Source§impl DatabaseEventBatch
impl DatabaseEventBatch
Sourcepub fn with_events(events: Vec<DatabaseEvent>) -> Self
pub fn with_events(events: Vec<DatabaseEvent>) -> Self
Create a batch with events.
Sourcepub fn control(directive: ControlDirective) -> Self
pub fn control(directive: ControlDirective) -> Self
Create a control batch that signals an administrative operation.
Sourcepub fn sequence_sync(sequences: Vec<SequenceValue>) -> Self
pub fn sequence_sync(sequences: Vec<SequenceValue>) -> Self
Create a sequence sync control batch with sequence values.
Sourcepub fn with_source_id(self, source_id: impl Into<String>) -> Self
pub fn with_source_id(self, source_id: impl Into<String>) -> Self
Set the source ID.
Sourcepub fn with_batch_seq(self, seq: u64) -> Self
pub fn with_batch_seq(self, seq: u64) -> Self
Set the batch sequence number.
Sourcepub fn with_control_directive(self, directive: ControlDirective) -> Self
pub fn with_control_directive(self, directive: ControlDirective) -> Self
Set the control directive.
Sourcepub fn with_sequence_values(self, sequences: Vec<SequenceValue>) -> Self
pub fn with_sequence_values(self, sequences: Vec<SequenceValue>) -> Self
Set sequence values.
Sourcepub fn with_backfill_metadata(self, metadata: BackfillMetadata) -> Self
pub fn with_backfill_metadata(self, metadata: BackfillMetadata) -> Self
Set backfill metadata for progress tracking.
Sourcepub fn is_control_batch(&self) -> bool
pub fn is_control_batch(&self) -> bool
Check if this is a control batch (no data events, just a directive).
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Estimate the size of this batch in bytes.
Trait Implementations§
Source§impl Clone for DatabaseEventBatch
impl Clone for DatabaseEventBatch
Source§fn clone(&self) -> DatabaseEventBatch
fn clone(&self) -> DatabaseEventBatch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more