CommitLog

Trait CommitLog 

Source
pub trait CommitLog:
    Clone
    + Send
    + Sync {
    // Required methods
    fn offsets<'life0, 'async_trait>(
        &'life0 self,
        topic: SmolStr,
        partition: u32,
    ) -> Pin<Box<dyn Future<Output = Option<PartitionOffsets>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn produce<'life0, 'async_trait>(
        &'life0 self,
        record: ProducerRecord,
    ) -> Pin<Box<dyn Future<Output = Result<ProducedOffset, ProducerError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn scoped_subscribe<'a>(
        &'a self,
        consumer_group_name: &str,
        offsets: Vec<ConsumerOffset>,
        subscriptions: Vec<Subscription>,
        idle_timeout: Option<Duration>,
    ) -> Pin<Box<dyn Stream<Item = ConsumerRecord> + Send + 'a>>;
}
Expand description

A commit log holds topics and can be appended to and tailed. Connections are managed and retried if they cannot be established.

Required Methods§

Source

fn offsets<'life0, 'async_trait>( &'life0 self, topic: SmolStr, partition: u32, ) -> Pin<Box<dyn Future<Output = Option<PartitionOffsets>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Retrieve the current offsets of a topic if they are present.

Source

fn produce<'life0, 'async_trait>( &'life0 self, record: ProducerRecord, ) -> Pin<Box<dyn Future<Output = Result<ProducedOffset, ProducerError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Publish a record and return the offset that was assigned.

Source

fn scoped_subscribe<'a>( &'a self, consumer_group_name: &str, offsets: Vec<ConsumerOffset>, subscriptions: Vec<Subscription>, idle_timeout: Option<Duration>, ) -> Pin<Box<dyn Stream<Item = ConsumerRecord> + Send + 'a>>

Subscribe to one or more topics for a given consumer group having committed zero or more topics. The records are streamed back indefinitely unless an idle timeout argument is provided. In the case of an idle timeout, if no record is received within that period, None is returned to end the stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§