pub struct BodyRedaction { /* private fields */ }Expand description
Holds only escaped, bounded body text plus read-only source metadata.
Implementations§
Source§impl BodyRedaction
impl BodyRedaction
Sourcepub const fn log_safe_text(&self) -> &LogSafeText<'static>
pub const fn log_safe_text(&self) -> &LogSafeText<'static>
Returns the escaped and output-bounded diagnostic text.
§Returns
A borrowed log-safe body representation including a complete
truncation marker whenever Self::is_truncated is true.
Sourcepub fn into_log_safe_text(self) -> LogSafeText<'static>
pub fn into_log_safe_text(self) -> LogSafeText<'static>
Consumes this result and returns its escaped diagnostic text.
§Returns
Owned log-safe body text including any truncation marker.
Sourcepub const fn status(&self) -> BodyRedactionStatus
pub const fn status(&self) -> BodyRedactionStatus
Sourcepub const fn captured_len(&self) -> usize
pub const fn captured_len(&self) -> usize
Returns the number of source bytes inspected.
§Returns
The byte count after applying the hard input budget.
Sourcepub const fn source_len(&self) -> Option<usize>
pub const fn source_len(&self) -> Option<usize>
Returns the complete source length when known.
§Returns
Some(total) for known source size, or None when a truncated source
had no exact total length.
Sourcepub const fn omitted_len(&self) -> Option<usize>
pub const fn omitted_len(&self) -> Option<usize>
Returns the exact number of omitted source bytes when known.
§Returns
Some(count) when the source length is known, or None otherwise.
Sourcepub const fn is_truncated(&self) -> bool
pub const fn is_truncated(&self) -> bool
Reports whether any source or rendered data was omitted.
§Returns
true for source capture, input-budget, or output-budget truncation.
Trait Implementations§
Source§impl Clone for BodyRedaction
impl Clone for BodyRedaction
Source§fn clone(&self) -> BodyRedaction
fn clone(&self) -> BodyRedaction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more