pub struct Limits {
pub max_string_length: u32,
pub max_depth: usize,
pub max_elements: usize,
}Expand description
Limits applied during deserialization to prevent excessive resource usage.
This is modeled after the PHP extension’s dd_mpack_limits structure:
max_string_length: Strings longer than this are truncatedmax_depth: Maximum nesting depth; deeper structures become nullmax_elements: Maximum total elements; excess elements are skipped
§Example
use libddwaf::serde::Limits;
let limits = Limits::default();
assert_eq!(limits.max_string_length, 4096);
assert_eq!(limits.max_depth, 21);
assert_eq!(limits.max_elements, 2048);
// Create custom limits
let custom = Limits {
max_string_length: 1024,
max_depth: 10,
max_elements: 100,
};Fields§
§max_string_length: u32§max_depth: usize§max_elements: usizeTrait Implementations§
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin 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