#[non_exhaustive]pub struct ParseOptions {
pub max_depth: usize,
}Expand description
Options for parse_with_options.
§Examples
use latex_rust::{parse_with_options, ParseOptions};
let deep = "{".repeat(40) + "x" + &"}".repeat(40);
assert!(parse_with_options(&deep, &ParseOptions::new()).is_err());
let roomy = ParseOptions::new().with_max_depth(128);
assert!(parse_with_options(&deep, &roomy).is_ok());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_depth: usizeDeepest parser recursion accepted. Defaults to DEFAULT_MAX_NESTING_DEPTH.
Implementations§
Source§impl ParseOptions
impl ParseOptions
Sourcepub fn with_max_depth(self, max_depth: usize) -> Self
pub fn with_max_depth(self, max_depth: usize) -> Self
Set the deepest parser recursion accepted.
Raising it past the default is safe only if the calling thread has the
stack for it; see DEFAULT_MAX_NESTING_DEPTH.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
impl Copy for ParseOptions
Source§impl Debug for ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
impl Eq for ParseOptions
Source§impl PartialEq for ParseOptions
impl PartialEq for ParseOptions
impl StructuralPartialEq for ParseOptions
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
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