pub trait AsyncRecordSink {
// Required methods
fn sink_record<'life0, 'life1, 'async_trait>(
&'life0 mut self,
data: &'life1 DataRecord,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sink_records<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<Arc<DataRecord>>,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for sinking structured records.
Provides methods for writing parsed, typed data records to a destination.
Implementations should handle batching efficiently when sink_records is called.
Required Methods§
Sourcefn sink_record<'life0, 'life1, 'async_trait>(
&'life0 mut self,
data: &'life1 DataRecord,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sink_record<'life0, 'life1, 'async_trait>(
&'life0 mut self,
data: &'life1 DataRecord,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn sink_records<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<Arc<DataRecord>>,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sink_records<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<Arc<DataRecord>>,
) -> Pin<Box<dyn Future<Output = SinkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write multiple data records in batch.
Implementations should optimize for batch writes when possible. The order of records in the vector should be preserved.
§Arguments
data- Vector of records wrapped in Arc for shared ownership