pub struct Limits { /* private fields */ }Expand description
Caller-selected hard limits applied before or while decoding JSON.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn new(
max_request_bytes: usize,
max_response_bytes: usize,
max_nesting: usize,
) -> Result<Self, LimitConfigurationError>
pub fn new( max_request_bytes: usize, max_response_bytes: usize, max_nesting: usize, ) -> Result<Self, LimitConfigurationError>
Creates a nonzero limit set.
Sourcepub const fn max_request_bytes(self) -> usize
pub const fn max_request_bytes(self) -> usize
Returns the request body byte limit.
Sourcepub const fn max_response_bytes(self) -> usize
pub const fn max_response_bytes(self) -> usize
Returns the response body byte limit.
Sourcepub const fn max_nesting(self) -> usize
pub const fn max_nesting(self) -> usize
Returns the JSON container nesting limit.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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