Skip to main content

qubit_redact/facade/
redaction_batch_handle.rs

1// =============================================================================
2//    Copyright (c) 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Opaque capabilities for unpublished batch items.
9
10/// Opaque reference to one unpublished item in a [`crate::RedactionBatch`].
11///
12/// ```compile_fail
13/// use qubit_redact::Redactor;
14///
15/// let mut batch = Redactor::strict().batch();
16/// let handle = batch.redact_field("password", "raw-secret");
17/// let _ = format!("{handle}");
18/// ```
19#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
20pub struct RedactionBatchHandle {
21    /// Identity of the batch that created this capability.
22    pub(super) batch_id: u64,
23    /// Insertion position of the protected item within its batch.
24    pub(super) item_index: usize,
25}