pub trait LineSink: Send + 'static {
type Output: Send + 'static;
// Required methods
fn on_line(&mut self, line: Cow<'_, str>) -> Next;
fn into_output(self) -> Self::Output;
// Provided methods
fn on_gap(&mut self) { ... }
fn on_eof(&mut self) { ... }
}Expand description
Per-line action selected by the StreamVisitor impl of LineAdapter.
Implementors only describe what should happen for each parsed line; chunk parsing, gap handling, and EOF flushing are carried by the adapter.
Required Associated Types§
Sourcetype Output: Send + 'static
type Output: Send + 'static
Final value produced once the adapter is finished. Returned via
Consumer::wait.
Required Methods§
Sourcefn on_line(&mut self, line: Cow<'_, str>) -> Next
fn on_line(&mut self, line: Cow<'_, str>) -> Next
Invoked for every parsed line. Return Next::Break to stop further parsing.
Sourcefn into_output(self) -> Self::Output
fn into_output(self) -> Self::Output
Consumes the sink and returns its final output.