1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Budget-aware redaction helpers for ordinary typed collections.
use Debug;
use RedactionWriter;
/// Writes a typed collection while admitting and formatting each item under
/// the writer's active collection budget.
///
/// # Type Parameters
///
/// * `T` - Collection item type, formatted through `Debug` only after
/// admission.
///
/// # Parameters
///
/// * `writer` - Structured writer carrying the active policy and budget.
/// * `variant` - Type name used to preserve the collection's debug shape.
/// * `values` - Collection payload whose items are written as unredacted
/// values.
///
/// # Behavior
///
/// Items are formatted only after the writer admits them, so a rejected item
/// and all later items are not accessed or formatted.
pub