pub struct RedactionUsage { /* private fields */ }Expand description
Measured resource use for one redaction transaction.
§Examples
use qubit_redact::Redactor;
let output = Redactor::standard().redact_field("id", "42");
assert_eq!(output.summary().usage().inspected_input_bytes(), 4);
assert_eq!(output.summary().usage().output_bytes(), 2);Implementations§
Source§impl RedactionUsage
impl RedactionUsage
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates an empty measurement for a newly started transaction.
§Returns
An empty measurement with all counters zero and known zero omissions.
Sourcepub const fn presented_input_bytes(self) -> usize
pub const fn presented_input_bytes(self) -> usize
Returns the bytes supplied by callers before input admission.
§Returns
Bytes presented at admitted or rejected public input boundaries.
Sourcepub const fn inspected_input_bytes(self) -> usize
pub const fn inspected_input_bytes(self) -> usize
Returns the bytes the transaction actually inspected.
§Returns
Source bytes successfully admitted for inspection, even if later discarded.
Sourcepub const fn output_bytes(self) -> usize
pub const fn output_bytes(self) -> usize
Returns the final escaped bytes retained by the transaction.
§Returns
Escaped bytes retained in the completed text or batch output.
Sourcepub const fn visited_nodes(self) -> usize
pub const fn visited_nodes(self) -> usize
Returns the admitted domain or format nodes visited by the transaction.
§Returns
Structural nodes successfully admitted during traversal.
Sourcepub const fn visited_collection_items(self) -> usize
pub const fn visited_collection_items(self) -> usize
Returns the admitted collection items visited by the transaction.
§Returns
Sequence and map entries successfully admitted during traversal.
Sourcepub const fn max_depth(self) -> usize
pub const fn max_depth(self) -> usize
Returns the greatest active structural depth observed by the transaction.
§Returns
The greatest active structural depth, or zero when no node was admitted.
Sourcepub const fn omitted_input_bytes(self) -> Option<usize>
pub const fn omitted_input_bytes(self) -> Option<usize>
Returns omitted source bytes when the source length is known.
§Returns
Some(bytes) counts known omissions; None means at least one source
had unknown total length, so the aggregate omission is unknown.
Trait Implementations§
Source§impl Clone for RedactionUsage
impl Clone for RedactionUsage
Source§fn clone(&self) -> RedactionUsage
fn clone(&self) -> RedactionUsage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more