pub struct RedactedJsonText<'text, 'policy> { /* private fields */ }Expand description
JSON text rendered with recursive object-key redaction.
fmt::Debug and fmt::Display are diagnostic boundaries: they reject
text larger than the policy diagnostic input budget before parsing it and
apply the policy output budget. Explicit mutation and Serde serialization
preserve complete JSON instead.
Implementations§
Source§impl<'text, 'policy> RedactedJsonText<'text, 'policy>
impl<'text, 'policy> RedactedJsonText<'text, 'policy>
Sourcepub const fn new(text: &'text str, policy: &'policy RedactionPolicy) -> Self
pub const fn new(text: &'text str, policy: &'policy RedactionPolicy) -> Self
Trait Implementations§
Source§impl Debug for RedactedJsonText<'_, '_>
impl Debug for RedactedJsonText<'_, '_>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats parsed redacted JSON or an opaque replacement for unsafe text.
Output that exceeds the diagnostic budget ends in the log truncation marker.
§Parameters
- formatter - Destination formatting context.
§Returns
The formatter result for a safe representation.
§Errors
Returns a formatting error when the destination rejects output.
Source§impl Display for RedactedJsonText<'_, '_>
impl Display for RedactedJsonText<'_, '_>
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Writes compact redacted JSON for a bounded plain-text log boundary.
Complete valid input that fits both diagnostic budgets produces compact valid JSON. Rejected input produces the opaque Secret mask; output that exceeds its budget ends in the log truncation marker and is not JSON.
§Parameters
- formatter - Destination formatting context.
§Returns
The formatter result for safe log output.
§Errors
Returns a formatting error when the destination rejects output.