Skip to main content

StreamTextParser

Trait StreamTextParser 

Source
pub trait StreamTextParser {
    type Extracted;

    // Required methods
    fn push_str(&mut self, chunk: &str) -> StreamTextChunk<Self::Extracted>;
    fn finish(&mut self) -> StreamTextChunk<Self::Extracted>;
}
Expand description

Trait for parsers that consume streamed text and emit visible text plus extracted payloads.

Required Associated Types§

Source

type Extracted

Payload extracted by this parser (for example a citation body).

Required Methods§

Source

fn push_str(&mut self, chunk: &str) -> StreamTextChunk<Self::Extracted>

Feed a new text chunk.

Source

fn finish(&mut self) -> StreamTextChunk<Self::Extracted>

Flush any buffered state at end-of-stream (or end-of-item).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§