riskless/messages/
delete_record_request.rs

1use crate::{batch_coordinator::TopicIdPartition, error::RisklessError};
2
3/// A request that represents the intention to delete a record at a specified offset.
4#[derive(Debug)]
5pub struct DeleteRecordsRequest {
6    /// The topic of the record.
7    pub topic: String,
8    /// Partition of a record.
9    pub partition: Vec<u8>,
10    /// The offset of this record.
11    pub offset: u64,
12}
13
14impl TryInto<crate::batch_coordinator::DeleteRecordsRequest> for DeleteRecordsRequest {
15    type Error = RisklessError;
16
17    fn try_into(self) -> Result<crate::batch_coordinator::DeleteRecordsRequest, Self::Error> {
18        Ok(crate::batch_coordinator::DeleteRecordsRequest {
19            topic_id_partition: TopicIdPartition(self.topic, self.partition),
20            offset: self.offset,
21        })
22    }
23}