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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! `RedactableWithMapper` implementations for standard library types.
//!
//! This module provides `RedactableWithMapper` implementations for common std
//! containers (`Option`, `Vec`, `VecDeque`, arrays, tuples, `Box`, locks, maps,
//! sets). When walking into these containers, they recursively apply redaction
//! to their contents.
//!
//! Passthrough leaf types still are not certified for `.redact()`. Container
//! certification forwards only when the contained values have declared
//! redaction behavior:
//!
//! ```compile_fail
//! use redactable::Redactable;
//!
//! let values = std::collections::VecDeque::from([String::from("raw")]);
//! let _ = values.redact();
//! ```
//!
//! ```compile_fail
//! use redactable::Redactable;
//!
//! let values = [String::from("raw")];
//! let _ = values.redact();
//! ```
//!
//! ```compile_fail
//! use redactable::Redactable;
//!
//! let values = (String::from("raw"),);
//! let _ = values.redact();
//! ```
//!
//! ```compile_fail
//! use redactable::Redactable;
//!
//! let value = std::sync::Mutex::new(String::from("raw"));
//! let _ = value.redact();
//! ```
//!
//! ```compile_fail
//! use redactable::Redactable;
//!
//! let value = std::sync::RwLock::new(String::from("raw"));
//! let _ = value.redact();
//! ```
//!
//! ## Map Keys Are Not Redacted
//!
//! For map containers (`HashMap`, `BTreeMap`), only **values** are redacted.
//! Keys are left untouched by design to preserve hashing/ordering invariants.
//! Do not place sensitive data in map keys unless you intend it to remain visible.
//!
//! ## Set Redaction Can Collapse Elements
//!
//! For set containers (`HashSet`, `BTreeSet`), redaction is applied to each
//! element and the results are collected back into a set. If redaction changes
//! equality or ordering (e.g., multiple values redact to `"[REDACTED]"`), the
//! resulting set may shrink.
// =============================================================================
// Passthrough implementation helper
// =============================================================================
pub use impl_redactable_container_passthrough;