pub struct SchemaParseLimits { /* private fields */ }Expand description
Resource ceilings applied before a schema document becomes trusted input.
Implementations§
Source§impl SchemaParseLimits
impl SchemaParseLimits
Sourcepub const fn new(
max_documents: usize,
max_aggregate_bytes: usize,
max_document_bytes: usize,
max_depth: usize,
max_nodes: usize,
max_scalar_source_bytes: usize,
) -> Self
pub const fn new( max_documents: usize, max_aggregate_bytes: usize, max_document_bytes: usize, max_depth: usize, max_nodes: usize, max_scalar_source_bytes: usize, ) -> Self
Creates explicit parser ceilings.
Sourcepub const fn max_documents(self) -> usize
pub const fn max_documents(self) -> usize
Returns the document-count ceiling.
Sourcepub const fn max_aggregate_bytes(self) -> usize
pub const fn max_aggregate_bytes(self) -> usize
Returns the aggregate-source-byte ceiling.
Sourcepub const fn max_document_bytes(self) -> usize
pub const fn max_document_bytes(self) -> usize
Returns the per-document source-byte ceiling.
Sourcepub const fn max_scalar_source_bytes(self) -> usize
pub const fn max_scalar_source_bytes(self) -> usize
Returns the YAML scalar source-token byte ceiling.
Sourcepub const fn max_scalar_bytes(self) -> usize
pub const fn max_scalar_bytes(self) -> usize
Returns the YAML scalar source-token byte ceiling.
This compatibility spelling preserves callers of the original parser limit API; the limit applies to exact YAML source bytes, not decoded canonical string bytes.
Trait Implementations§
Source§impl Clone for SchemaParseLimits
impl Clone for SchemaParseLimits
Source§fn clone(&self) -> SchemaParseLimits
fn clone(&self) -> SchemaParseLimits
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 SchemaParseLimits
Source§impl Debug for SchemaParseLimits
impl Debug for SchemaParseLimits
Source§impl Default for SchemaParseLimits
impl Default for SchemaParseLimits
impl Eq for SchemaParseLimits
Source§impl PartialEq for SchemaParseLimits
impl PartialEq for SchemaParseLimits
impl StructuralPartialEq for SchemaParseLimits
Auto Trait Implementations§
impl Freeze for SchemaParseLimits
impl RefUnwindSafe for SchemaParseLimits
impl Send for SchemaParseLimits
impl Sync for SchemaParseLimits
impl Unpin for SchemaParseLimits
impl UnsafeUnpin for SchemaParseLimits
impl UnwindSafe for SchemaParseLimits
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