Skip to main content

StreamBackend

Trait StreamBackend 

Source
pub trait StreamBackend: Send + Sync {
Show 13 methods // Required methods fn name(&self) -> &'static str; fn connect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn disconnect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_topic<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, partitions: u32, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_topic<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_topics<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<TopicName>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_event<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, event: StreamEvent, ) -> Pin<Box<dyn Future<Output = StreamResult<Offset>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn send_batch<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, events: Vec<StreamEvent>, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<Offset>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn receive_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: Option<&'life2 ConsumerGroup>, position: StreamPosition, max_events: usize, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(StreamEvent, Offset)>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn commit_offset<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, partition: PartitionId, offset: Offset, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn seek<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, partition: PartitionId, position: StreamPosition, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_consumer_lag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, ) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<PartitionId, u64>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_topic_metadata<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, ) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<String, String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

Common trait for all streaming backends

Required Methods§

Source

fn name(&self) -> &'static str

Get the name of this backend

Source

fn connect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Connect to the backend

Source

fn disconnect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Disconnect from the backend

Source

fn create_topic<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, partitions: u32, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new topic/stream

Source

fn delete_topic<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a topic/stream

Source

fn list_topics<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<TopicName>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all topics/streams

Source

fn send_event<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, event: StreamEvent, ) -> Pin<Box<dyn Future<Output = StreamResult<Offset>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a single event

Source

fn send_batch<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, events: Vec<StreamEvent>, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<Offset>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send multiple events as a batch

Source

fn receive_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: Option<&'life2 ConsumerGroup>, position: StreamPosition, max_events: usize, ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(StreamEvent, Offset)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Receive events from a topic

Source

fn commit_offset<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, partition: PartitionId, offset: Offset, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Commit consumer offset

Source

fn seek<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, partition: PartitionId, position: StreamPosition, ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Seek to a specific position

Source

fn get_consumer_lag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 TopicName, consumer_group: &'life2 ConsumerGroup, ) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<PartitionId, u64>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get consumer lag information

Source

fn get_topic_metadata<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 TopicName, ) -> Pin<Box<dyn Future<Output = StreamResult<HashMap<String, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get topic metadata

Implementors§