Skip to main content

confluent_kafka/admin/
deleted_records.rs

1// Copyright 2025 Confluent Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Represents information about deleted records.
16
17/// Represents information about deleted records.
18#[derive(Clone, Debug)]
19#[doc(alias = "org.apache.kafka.clients.admin.DeletedRecords")]
20pub struct DeletedRecords {
21    low_watermark: i64,
22}
23
24impl DeletedRecords {
25    /// Create an instance of this class with the provided parameters.
26    ///
27    /// # Arguments
28    ///
29    /// - `low_watermark` - "low watermark" for the topic partition on which the deletion was
30    ///   executed
31    #[doc(alias = "org.apache.kafka.clients.admin.DeletedRecords#DeletedRecords")]
32    pub fn new(low_watermark: i64) -> Self {
33        Self { low_watermark }
34    }
35
36    /// Returns the "low watermark" for the topic partition on which the deletion
37    /// was executed.
38    #[doc(alias = "org.apache.kafka.clients.admin.DeletedRecords#lowWatermark")]
39    pub fn low_watermark(&self) -> i64 {
40        self.low_watermark
41    }
42}
43
44#[cfg(test)]
45mod tests {
46    use super::*;
47
48    #[test]
49    fn low_watermark_round_trip() {
50        assert_eq!(DeletedRecords::new(42).low_watermark(), 42);
51    }
52}