1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::binary;
use crate::client::ConsumerOffsetClient;
use crate::consumer_offsets::get_consumer_offset::GetConsumerOffset;
use crate::consumer_offsets::store_consumer_offset::StoreConsumerOffset;
use crate::error::Error;
use crate::models::consumer_offset_info::ConsumerOffsetInfo;
use crate::quic::client::QuicClient;
use async_trait::async_trait;

#[async_trait]
impl ConsumerOffsetClient for QuicClient {
    async fn store_consumer_offset(&self, command: &StoreConsumerOffset) -> Result<(), Error> {
        binary::consumer_offsets::store_consumer_offset(self, command).await
    }

    async fn get_consumer_offset(
        &self,
        command: &GetConsumerOffset,
    ) -> Result<ConsumerOffsetInfo, Error> {
        binary::consumer_offsets::get_consumer_offset(self, command).await
    }
}