pub struct RedactionLimits { /* private fields */ }Expand description
Structural and JSON limits for one redaction operation.
§Examples
use qubit_redact::RedactionLimits;
let mut builder = RedactionLimits::builder();
builder.max_output_bytes(128);
let limits = builder.build();
assert_eq!(limits.max_output_bytes(), 128);Implementations§
Source§impl RedactionLimits
impl RedactionLimits
Sourcepub fn builder() -> RedactionLimitsBuilder
pub fn builder() -> RedactionLimitsBuilder
Creates a builder initialized with the standard redaction limits.
§Returns
A mutable builder initialized with finite standard resource ceilings.
Sourcepub const fn max_input_bytes(&self) -> usize
pub const fn max_input_bytes(&self) -> usize
Returns the maximum source bytes one transaction may inspect.
§Returns
Cumulative source bytes admitted by one transaction.
Sourcepub const fn max_output_bytes(&self) -> usize
pub const fn max_output_bytes(&self) -> usize
Returns the maximum safe output bytes one transaction may retain.
§Returns
Maximum final output bytes retained by one transaction.
Sourcepub const fn max_serde_payload_bytes(&self) -> usize
pub const fn max_serde_payload_bytes(&self) -> usize
Returns the logical scalar payload limit for a structured Serde scope.
Counts UTF-8 strings/chars, byte slices, and scalar representations.
Excludes static field names, container framing, and serializer escaping.
A caller-owned serializer controls its final encoded byte length;
Redactor::to_json additionally enforces max_output_bytes
when the json feature is enabled. The default is 16 KiB; zero is
valid.
§Examples
use qubit_redact::RedactionLimits;
let mut builder = RedactionLimits::builder();
builder.max_serde_payload_bytes(4).max_output_bytes(32);
assert_eq!(builder.build().max_serde_payload_bytes(), 4);§Returns
Logical scalar bytes admitted by one structured Serde scope.
Sourcepub const fn max_depth(&self) -> Option<usize>
pub const fn max_depth(&self) -> Option<usize>
Returns the maximum nested structural depth.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_nodes(&self) -> Option<usize>
pub const fn max_nodes(&self) -> Option<usize>
Returns the maximum number of structural nodes.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_collection_items(&self) -> Option<usize>
pub const fn max_collection_items(&self) -> Option<usize>
Returns the cumulative item allowance shared by transaction collections.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_key_bytes(&self) -> Option<usize>
pub const fn max_key_bytes(&self) -> Option<usize>
Returns the maximum raw UTF-8 length of a domain field or classification key, checked before normalization and value access. JSON keys also have their independent JSON admission limits.
§Returns
Some(maximum) bounds raw key bytes; None disables this limit.
Sourcepub const fn max_json_depth(&self) -> Option<usize>
pub const fn max_json_depth(&self) -> Option<usize>
Returns the maximum JSON nesting depth.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_nodes(&self) -> Option<usize>
pub const fn max_json_nodes(&self) -> Option<usize>
Returns the maximum number of JSON nodes.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_collection_items(&self) -> Option<usize>
pub const fn max_json_collection_items(&self) -> Option<usize>
Returns the maximum number of items in one JSON collection.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_key_bytes(&self) -> Option<usize>
pub const fn max_json_key_bytes(&self) -> Option<usize>
Returns the maximum JSON object-key length.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_string_bytes(&self) -> Option<usize>
pub const fn max_json_string_bytes(&self) -> Option<usize>
Returns the maximum JSON string length.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_number_bytes(&self) -> Option<usize>
pub const fn max_json_number_bytes(&self) -> Option<usize>
Returns the maximum JSON number representation length.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Sourcepub const fn max_json_payload_bytes(&self) -> Option<usize>
pub const fn max_json_payload_bytes(&self) -> Option<usize>
Returns the cumulative JSON payload-byte maximum.
§Returns
Some(maximum) is the configured ceiling; None disables this limit.
Trait Implementations§
Source§impl Clone for RedactionLimits
impl Clone for RedactionLimits
Source§fn clone(&self) -> RedactionLimits
fn clone(&self) -> RedactionLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more