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§
Required Methods§
Sourcefn push_str(&mut self, chunk: &str) -> StreamTextChunk<Self::Extracted>
fn push_str(&mut self, chunk: &str) -> StreamTextChunk<Self::Extracted>
Feed a new text chunk.
Sourcefn finish(&mut self) -> StreamTextChunk<Self::Extracted>
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".