pub struct Parser { /* private fields */ }Expand description
Streaming markdown parser.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_state(state: ParseState) -> Self
pub fn with_state(state: ParseState) -> Self
Create a parser with a custom ParseState.
pub fn state(&self) -> &ParseState
pub fn state_mut(&mut self) -> &mut ParseState
pub fn set_process_links(&mut self, enabled: bool)
pub fn set_process_images(&mut self, enabled: bool)
Sourcepub fn set_code_spaces(&mut self, enabled: bool)
pub fn set_code_spaces(&mut self, enabled: bool)
Enable space-indented code blocks (4 spaces = code).
Sourcepub fn parse_line(&mut self, line: &str) -> Vec<ParseEvent>
pub fn parse_line(&mut self, line: &str) -> Vec<ParseEvent>
Parse a single line and return events.
Sourcepub fn parse_document(&mut self, content: &str) -> Vec<ParseEvent>
pub fn parse_document(&mut self, content: &str) -> Vec<ParseEvent>
Parse a complete document.
Sourcepub fn finalize(&mut self) -> Vec<ParseEvent>
pub fn finalize(&mut self) -> Vec<ParseEvent>
Finalize parsing, closing any open blocks.
Trait Implementations§
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