pub trait AsAsyncConsumer:
Sized
+ Send
+ Sync {
type Offset: IsOffset;
type Meta: IsAsyncMeta;
type Data: IsAsyncData;
Show 14 methods
// Required methods
fn default_timeout(&self) -> Timeout;
fn subscribe<'life0, 'async_trait, T, I>(
&'life0 mut self,
topics: I,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where T: 'async_trait + Into<String>,
I: 'async_trait + IntoIterator<Item = T> + Send,
Self: 'async_trait,
'life0: 'async_trait;
fn recv_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Timeout,
) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'life0, 'async_trait>(
&'life0 self,
offset: Self::Offset,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit_offset<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
vgroup_id: VGroupId,
offset: i64,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + 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 = RawResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn assignments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Vec<(String, Vec<Assignment>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn topic_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<Assignment>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn offset_seek<'life0, 'life1, 'async_trait>(
&'life0 mut self,
topic: &'life1 str,
vgroup_id: VGroupId,
offset: i64,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn committed<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
vgroup_id: VGroupId,
) -> Pin<Box<dyn Future<Output = RawResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn position<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
vgroup_id: VGroupId,
) -> Pin<Box<dyn Future<Output = RawResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn stream_with_timeout(
&self,
timeout: Timeout,
) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>> { ... }
fn stream(
&self,
) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>> { ... }
fn unsubscribe<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait { ... }
}Required Associated Types§
Required Methods§
fn default_timeout(&self) -> Timeout
fn subscribe<'life0, 'async_trait, T, I>(
&'life0 mut self,
topics: I,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>where
T: 'async_trait + Into<String>,
I: 'async_trait + IntoIterator<Item = T> + Send,
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn recv_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Timeout,
) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Timeout,
) -> Pin<Box<dyn Future<Output = RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
None means wait until next message come.
fn commit<'life0, 'async_trait>(
&'life0 self,
offset: Self::Offset,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit_offset<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_name: &'life1 str,
vgroup_id: VGroupId,
offset: i64,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + 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 = RawResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn assignments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Vec<(String, Vec<Assignment>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn topic_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<Assignment>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn offset_seek<'life0, 'life1, 'async_trait>(
&'life0 mut self,
topic: &'life1 str,
vgroup_id: VGroupId,
offset: i64,
) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn committed<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
vgroup_id: VGroupId,
) -> Pin<Box<dyn Future<Output = RawResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn position<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
vgroup_id: VGroupId,
) -> Pin<Box<dyn Future<Output = RawResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn stream_with_timeout( &self, timeout: Timeout, ) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>>
fn stream( &self, ) -> Pin<Box<dyn Send + Stream<Item = RawResult<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> + '_>>
fn unsubscribe<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
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.