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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// =============================================================================
// Copyright (c) 2025 - 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! # Qubit Redact
//!
//! Borrowed domain redaction for logs, errors, and structured diagnostics.
//! Choose [`Redactor::redact_view`] for lazy formatting/serialization, or
//! [`Redactor::redact_text`] for finalized text and a completeness summary.
//! With `json`, `Redactor::to_json` serializes a domain view directly.
//!
//! ```
//! use qubit_redact::Redactor;
//!
//! let output = Redactor::standard().redact_field("password", "raw-secret");
//! assert_eq!(output.text().as_str(), "<redacted>");
//! ```
//!
//! ## Domain and serialization capabilities
//!
//! `#[derive(Redact)]` implements [`Redact`]. `#[redact(debug)]` and
//! `#[redact(display)]` opt into ordinary diagnostic formatting. With `serde`,
//! the derive also generates structured redaction for views. Adding
//! `#[redact(serde)]` makes the source's ordinary Serialize implementation
//! redacted as well.
//!
//! [`RedactScalar`] supports one-field scalar newtypes without implementing
//! business Debug, Display, or Serialize. Explicit `level` annotations at the
//! use site determine sensitivity. Third-party values can select
//! `#[redact(level = "secret", display)]`.
//!
//! ## Policies and execution
//!
//! Views own immutable policy snapshots but borrow live source values. Every
//! use starts a new execution and budget. [`RedactedText`] is finalized and
//! does not run redaction again. [`DiagnosticRedactionBatch`] shares a budget
//! across related values; [`RedactedTextComposer`] builds one ordered message.
//!
//! Unmarked fields remain ordinary output. Explicit derive levels are final;
//! runtime field rules, floors, and strict mode do not override them. Disabled
//! policy deliberately restores source values. Generated ordinary formatting
//! and serialization read the application default at each call; explicit
//! views and redactors retain their captured policies.
//!
//! Text completion describes diagnostic completeness under the selected
//! policy. Ordinary logging can use `output.text()` directly; audit callers
//! can inspect summaries or reject incomplete text. This library does not
//! erase source memory or protect output that bypasses its entry points.
//!
//! See the [user guide](https://github.com/qubit-ltd/rs-redact/blob/main/doc/user_guide.md)
//! for complete setup, type/attribute tables, format integrations, and budgets.
extern crate self as qubit_redact;
pub use Redact;
pub
pub use Redact;
pub use RedactScalar;
pub use RedactSerialize;
pub use RedactionWriter;
pub use DebugDisplay;
pub use DiagnosticRedactionBatch;
pub use DiagnosticRedactionHandle;
pub use DiagnosticRedactionOutput;
pub use RedactedText;
pub use RedactedTextComposer;
pub use RedactedView;
pub use RedactionInspection;
pub use RedactionInspectionError;
pub use RedactionReason;
pub use RedactionReasons;
pub use RedactionSummary;
pub use RedactionTextOutput;
pub use RedactionUsage;
pub use Redactor;
pub use RedactionCompletion;
pub use AllowRule;
pub use FieldClassification;
pub use FieldMatchKind;
pub use FieldNameMatching;
pub use FieldsBuilder;
pub use HttpContextBuilderView;
pub use HttpPolicyBuilderView;
pub use MaskPolicy;
pub use MaskingPolicy;
pub use MaskingPolicyBuilder;
pub use PolicyError;
pub use PolicyLocation;
pub use RedactionFloor;
pub use RedactionFloorBuilder;
pub use RedactionLimits;
pub use RedactionLimitsBuilder;
pub use RedactionPolicy;
pub use RedactionPolicyBuilder;
pub use RedactionRules;
pub use SensitiveFieldPreset;
pub use SensitiveFieldRule;
pub use Sensitivity;
pub use UnkeyedJsonValuePolicy;
pub use UnknownFieldPolicy;
pub use UriPolicyBuilderView;
pub use RedactScalar;
pub use RedactionHandle;
pub use RedactionHandleError;