pub struct ValidationLimits {
pub max_depth: usize,
pub max_nodes: usize,
pub max_string_bytes: usize,
pub max_key_bytes: usize,
pub max_total_string_bytes: usize,
}Expand description
Limits applied before compiling or validating untrusted JSON schema values.
Fields§
§max_depth: usizeMaximum structural nesting depth.
max_nodes: usizeMaximum number of JSON nodes.
max_string_bytes: usizeMaximum UTF-8 byte length for a single JSON string value.
max_key_bytes: usizeMaximum UTF-8 byte length for a single JSON object key.
max_total_string_bytes: usizeMaximum cumulative UTF-8 bytes across all object keys and string values.
Implementations§
Source§impl ValidationLimits
impl ValidationLimits
Sourcepub const fn with_max_string_bytes(self, max_string_bytes: usize) -> Self
pub const fn with_max_string_bytes(self, max_string_bytes: usize) -> Self
Override the maximum UTF-8 byte length for a single JSON string value.
Sourcepub const fn with_max_key_bytes(self, max_key_bytes: usize) -> Self
pub const fn with_max_key_bytes(self, max_key_bytes: usize) -> Self
Override the maximum UTF-8 byte length for a single JSON object key.
Sourcepub const fn with_max_total_string_bytes(
self,
max_total_string_bytes: usize,
) -> Self
pub const fn with_max_total_string_bytes( self, max_total_string_bytes: usize, ) -> Self
Override the maximum cumulative UTF-8 bytes across keys and strings.
Trait Implementations§
Source§impl Clone for ValidationLimits
impl Clone for ValidationLimits
Source§fn clone(&self) -> ValidationLimits
fn clone(&self) -> ValidationLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ValidationLimits
Source§impl Debug for ValidationLimits
impl Debug for ValidationLimits
Source§impl Default for ValidationLimits
impl Default for ValidationLimits
impl Eq for ValidationLimits
Source§impl PartialEq for ValidationLimits
impl PartialEq for ValidationLimits
impl StructuralPartialEq for ValidationLimits
Auto Trait Implementations§
impl Freeze for ValidationLimits
impl RefUnwindSafe for ValidationLimits
impl Send for ValidationLimits
impl Sync for ValidationLimits
impl Unpin for ValidationLimits
impl UnsafeUnpin for ValidationLimits
impl UnwindSafe for ValidationLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.