pub struct WaitForLineSink<P> { /* private fields */ }Expand description
LineSink that breaks the moment a predicate accepts a line and remembers whether it
has matched yet. Compose with
LineAdapter to drive wait_for_line, or to
build your own custom predicate-driven consumer outside the built-in factory methods.
Implementations§
Trait Implementations§
Source§impl<P> LineSink for WaitForLineSink<P>
impl<P> LineSink for WaitForLineSink<P>
Source§type Output = bool
type Output = bool
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<P> Freeze for WaitForLineSink<P>where
P: Freeze,
impl<P> RefUnwindSafe for WaitForLineSink<P>where
P: RefUnwindSafe,
impl<P> Send for WaitForLineSink<P>where
P: Send,
impl<P> Sync for WaitForLineSink<P>where
P: Sync,
impl<P> Unpin for WaitForLineSink<P>where
P: Unpin,
impl<P> UnsafeUnpin for WaitForLineSink<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for WaitForLineSink<P>where
P: 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