Skip to main content

RedactionLimits

Struct RedactionLimits 

Source
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

Source

pub fn builder() -> RedactionLimitsBuilder

Creates a builder initialized with the standard redaction limits.

§Returns

A mutable builder initialized with finite standard resource ceilings.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> RedactionLimits

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RedactionLimits

Source§

impl Debug for RedactionLimits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RedactionLimits

Source§

fn default() -> Self

Builds the immutable standard limit snapshot.

§Returns

The standard immutable resource limits produced by the default builder.

Source§

impl Eq for RedactionLimits

Source§

impl PartialEq for RedactionLimits

Source§

fn eq(&self, other: &RedactionLimits) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RedactionLimits

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.