pub struct Parser { /* private fields */ }Expand description
LiteDoc parser with configurable profile and error recovery.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_recovery(self, recover: bool) -> Self
pub fn with_recovery(self, recover: bool) -> Self
Enable or disable error recovery mode.
When enabled (default), the parser will attempt to continue parsing after encountering errors, collecting them for later inspection. When disabled, parsing stops at the first error.
Sourcepub fn parse_with_recovery<'a>(&mut self, input: &'a str) -> ParseResult<'a>
pub fn parse_with_recovery<'a>(&mut self, input: &'a str) -> ParseResult<'a>
Parse with error recovery, returning both document and errors.
Sourcepub fn parse<'a>(&mut self, input: &'a str) -> Result<Document<'a>, ParseError>
pub fn parse<'a>(&mut self, input: &'a str) -> Result<Document<'a>, ParseError>
Parse the input, returning an error on first failure.
Sourcepub fn has_module(&self, module: Module) -> bool
pub fn has_module(&self, module: Module) -> bool
Check if the given module is enabled.
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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