pub trait Parser {
// Required methods
fn write(&mut self, chunk: &[u8]) -> Vec<Event>;
fn flush(&mut self) -> Vec<Event>;
fn reset(&mut self);
}Expand description
An incremental, chunk-safe Markdown parser.
Feed bytes with write and drain the returned events; call
flush at end of input to close any open blocks. The emitted event stream is
independent of how the input is split across write calls (split-equivalence) — the single
most important invariant of this library.
Required Methods§
Sourcefn write(&mut self, chunk: &[u8]) -> Vec<Event>
fn write(&mut self, chunk: &[u8]) -> Vec<Event>
Feed a chunk of input. Returns any events that became complete as a result. A chunk may end
mid-line; the parser buffers the remainder until the next write/flush.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".