pub struct RedactionTextOutput { /* private fields */ }Expand description
Published safe text and completion metadata from one redaction operation.
When redaction is enabled, Self::text remains confidentiality-safe for
every completion state. Truncated and Exhausted describe incomplete
diagnostics, not unsafe text. Callers need to reject or replace such text
only when their own contract requires completeness.
§Examples
use qubit_redact::RedactionCompletion;
use qubit_redact::Redactor;
let output = Redactor::strict().redact_field("password", "raw-secret");
assert_eq!(output.summary().completion(), RedactionCompletion::Complete);Implementations§
Source§impl RedactionTextOutput
impl RedactionTextOutput
Sourcepub const fn text(&self) -> &RedactedText
pub const fn text(&self) -> &RedactedText
Borrows the final text.
Sourcepub const fn summary(&self) -> &RedactionSummary
pub const fn summary(&self) -> &RedactionSummary
Borrows the execution summary.
Sourcepub fn complete_text(&self) -> Result<&RedactedText, &RedactionSummary>
pub fn complete_text(&self) -> Result<&RedactedText, &RedactionSummary>
Borrows the final text when the operation completed without truncation or exhaustion.
§Errors
Returns the execution summary when the safe output was truncated or exhausted. The error reports completeness; it does not imply that the published text is unsafe for diagnostics.
Sourcepub fn text_or_marker(&self, marker: &str) -> Cow<'_, str>
pub fn text_or_marker(&self, marker: &str) -> Cow<'_, str>
Borrows the final text or returns an escaped caller-selected marker when the operation was incomplete.
The complete path does not allocate. An incomplete marker is escaped before publication so control characters cannot forge diagnostic log structure. The marker is selected after the transaction and therefore does not consume its resource budget.
Sourcepub fn into_complete_text(self) -> Result<RedactedText, RedactionSummary>
pub fn into_complete_text(self) -> Result<RedactedText, RedactionSummary>
Consumes a complete output and returns its final text.
§Errors
Returns the execution summary when the safe output was truncated or exhausted. The error reports completeness; it does not imply that the published text is unsafe for diagnostics.
Sourcepub fn into_text_or_marker(self, marker: &str) -> RedactedText
pub fn into_text_or_marker(self, marker: &str) -> RedactedText
Consumes the output and returns a caller-selected marker when it is incomplete.
The marker is escaped before becoming RedactedText, so it remains
safe for diagnostic presentation.
Sourcepub fn into_parts(self) -> (RedactedText, RedactionSummary)
pub fn into_parts(self) -> (RedactedText, RedactionSummary)
Consumes the output and returns both parts.
Trait Implementations§
Source§impl Clone for RedactionTextOutput
impl Clone for RedactionTextOutput
Source§fn clone(&self) -> RedactionTextOutput
fn clone(&self) -> RedactionTextOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more