pub struct InspectLimits {
pub max_depth: usize,
pub max_items: usize,
pub max_nodes: usize,
pub max_string_length: usize,
pub max_bytes: usize,
}Expand description
Limits to prevent pathological inspection behavior.
These limits protect against accidentally traversing enormous data structures, infinite loops, or excessive memory allocation during introspection.
Fields§
§max_depth: usizeMaximum tree depth to traverse.
max_items: usizeMaximum number of items to inspect in a collection.
max_nodes: usizeMaximum total number of nodes to visit.
max_string_length: usizeMaximum length of a string to include.
max_bytes: usizeMaximum number of bytes to include.
Implementations§
Source§impl InspectLimits
impl InspectLimits
Sourcepub const fn unlimited() -> InspectLimits
pub const fn unlimited() -> InspectLimits
Create limits with all constraints set to maximum.
Sourcepub const fn debug() -> InspectLimits
pub const fn debug() -> InspectLimits
Create limits suitable for interactive debugging.
Sourcepub const fn compact() -> InspectLimits
pub const fn compact() -> InspectLimits
Create limits suitable for compact logging.
Trait Implementations§
Source§impl Clone for InspectLimits
impl Clone for InspectLimits
Source§fn clone(&self) -> InspectLimits
fn clone(&self) -> InspectLimits
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 InspectLimits
Source§impl Debug for InspectLimits
impl Debug for InspectLimits
Source§impl Default for InspectLimits
impl Default for InspectLimits
Source§fn default() -> InspectLimits
fn default() -> InspectLimits
Returns the “default value” for a type. Read more
impl Eq for InspectLimits
Source§impl PartialEq for InspectLimits
impl PartialEq for InspectLimits
impl StructuralPartialEq for InspectLimits
Auto Trait Implementations§
impl Freeze for InspectLimits
impl RefUnwindSafe for InspectLimits
impl Send for InspectLimits
impl Sync for InspectLimits
impl Unpin for InspectLimits
impl UnsafeUnpin for InspectLimits
impl UnwindSafe for InspectLimits
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