use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
use iggy_common::SegmentClient;
use iggy_common::{Identifier, IggyError};
#[async_trait]
impl SegmentClient for ClientWrapper {
async fn delete_segments(
&self,
stream_id: &Identifier,
topic_id: &Identifier,
partition_id: u32,
segments_count: u32,
) -> Result<(), IggyError> {
match self {
ClientWrapper::Iggy(client) => {
client
.delete_segments(stream_id, topic_id, partition_id, segments_count)
.await
}
ClientWrapper::Http(client) => {
client
.delete_segments(stream_id, topic_id, partition_id, segments_count)
.await
}
ClientWrapper::Tcp(client) => {
client
.delete_segments(stream_id, topic_id, partition_id, segments_count)
.await
}
ClientWrapper::Quic(client) => {
client
.delete_segments(stream_id, topic_id, partition_id, segments_count)
.await
}
ClientWrapper::WebSocket(client) => {
client
.delete_segments(stream_id, topic_id, partition_id, segments_count)
.await
}
}
}
}