pub struct ParserConfig {
pub max_depth: usize,
}Expand description
Configuration for the bencode parser
Fields§
§max_depth: usizeMaximum depth of nested structures (default: 100) Set to prevent stack overflow from malicious deeply nested data
Implementations§
Source§impl ParserConfig
impl ParserConfig
Sourcepub const fn with_max_depth(self, max_depth: usize) -> Self
pub const fn with_max_depth(self, max_depth: usize) -> Self
Set the maximum nesting depth
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
impl Copy for ParserConfig
Source§impl Debug for ParserConfig
impl Debug for ParserConfig
Auto Trait Implementations§
impl Freeze for ParserConfig
impl RefUnwindSafe for ParserConfig
impl Send for ParserConfig
impl Sync for ParserConfig
impl Unpin for ParserConfig
impl UnsafeUnpin for ParserConfig
impl UnwindSafe for ParserConfig
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