pub struct ParseLimits {
pub max_input_bytes: usize,
pub max_depth: usize,
pub max_nodes: usize,
pub max_line_length: usize,
pub max_output_bytes: usize,
}Expand description
Configurable parsing limits with secure defaults.
Fields§
§max_input_bytes: usize§max_depth: usize§max_nodes: usize§max_line_length: usize§max_output_bytes: usizeImplementations§
Source§impl ParseLimits
impl ParseLimits
Sourcepub fn with_max_input_bytes(self, value: usize) -> Self
pub fn with_max_input_bytes(self, value: usize) -> Self
Explicitly raise or set the input byte limit.
Sourcepub fn with_max_depth(self, value: usize) -> Self
pub fn with_max_depth(self, value: usize) -> Self
Explicitly raise or set the nesting depth limit.
Sourcepub fn with_max_nodes(self, value: usize) -> Self
pub fn with_max_nodes(self, value: usize) -> Self
Explicitly raise or set the node count limit.
Sourcepub fn with_max_line_length(self, value: usize) -> Self
pub fn with_max_line_length(self, value: usize) -> Self
Explicitly raise or set the line length limit.
Sourcepub fn with_max_output_bytes(self, value: usize) -> Self
pub fn with_max_output_bytes(self, value: usize) -> Self
Explicitly raise or set the output byte limit.
Sourcepub fn clamp_max_input_bytes(self, value: usize) -> Self
pub fn clamp_max_input_bytes(self, value: usize) -> Self
Lower the input byte limit. Never raises it.
Sourcepub fn clamp_max_depth(self, value: usize) -> Self
pub fn clamp_max_depth(self, value: usize) -> Self
Lower the depth limit. Never raises it.
Sourcepub fn clamp_max_nodes(self, value: usize) -> Self
pub fn clamp_max_nodes(self, value: usize) -> Self
Lower the node count limit. Never raises it.
Sourcepub fn clamp_max_line_length(self, value: usize) -> Self
pub fn clamp_max_line_length(self, value: usize) -> Self
Lower the line length limit. Never raises it.
Sourcepub fn clamp_max_output_bytes(self, value: usize) -> Self
pub fn clamp_max_output_bytes(self, value: usize) -> Self
Lower the output byte limit. Never raises it.
Sourcepub fn validate_input(&self, markdown: &str) -> Result<(), ParseLimitsError>
pub fn validate_input(&self, markdown: &str) -> Result<(), ParseLimitsError>
Validate limits that can be checked before parsing begins.
Trait Implementations§
Source§impl Clone for ParseLimits
impl Clone for ParseLimits
impl Copy for ParseLimits
Source§impl Debug for ParseLimits
impl Debug for ParseLimits
Source§impl Default for ParseLimits
impl Default for ParseLimits
impl Eq for ParseLimits
Source§impl PartialEq for ParseLimits
impl PartialEq for ParseLimits
impl StructuralPartialEq for ParseLimits
Auto Trait Implementations§
impl Freeze for ParseLimits
impl RefUnwindSafe for ParseLimits
impl Send for ParseLimits
impl Sync for ParseLimits
impl Unpin for ParseLimits
impl UnsafeUnpin for ParseLimits
impl UnwindSafe for ParseLimits
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.