pub struct CollectLineSink<T, F> { /* private fields */ }Expand description
LineSink holding the user closure and a sink; on_line calls the closure with the
line and a &mut borrow of the sink. Compose with
LineAdapter to drive collect_lines, or to
build your own custom collect-lines consumer outside the built-in factory methods.
Implementations§
Trait Implementations§
Source§impl<T, F> LineSink for CollectLineSink<T, F>
impl<T, F> LineSink for CollectLineSink<T, F>
Source§type Output = T
type Output = T
Final value produced once the adapter is finished. Returned via
Consumer::wait.Source§fn 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.Source§fn into_output(self) -> Self::Output
fn into_output(self) -> Self::Output
Consumes the sink and returns its final output.
Auto Trait Implementations§
impl<T, F> Freeze for CollectLineSink<T, F>
impl<T, F> RefUnwindSafe for CollectLineSink<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for CollectLineSink<T, F>
impl<T, F> Sync for CollectLineSink<T, F>
impl<T, F> Unpin for CollectLineSink<T, F>
impl<T, F> UnsafeUnpin for CollectLineSink<T, F>where
T: UnsafeUnpin,
F: UnsafeUnpin,
impl<T, F> UnwindSafe for CollectLineSink<T, F>where
T: UnwindSafe,
F: UnwindSafe,
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