pub struct WaitForLine<P> { /* private fields */ }Expand description
LineVisitor that breaks the moment a predicate accepts a line and remembers whether it
has matched yet. Compose with
ParseLines to build a
predicate-driven consumer; the backends’ wait_for_line helpers wrap this same visitor with
an additional tokio::time::timeout.
There is no async counterpart. The predicate is a synchronous
Fn(Cow<'_, str>) -> bool and has no .await, so an AsyncLineVisitor would not add
capability. If you need to react asynchronously when a matching line is observed, await
Consumer::wait on this visitor’s consumer and dispatch from there.
Implementations§
Trait Implementations§
Source§impl<P> LineVisitor for WaitForLine<P>
impl<P> LineVisitor for WaitForLine<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 WaitForLine<P>where
P: Freeze,
impl<P> RefUnwindSafe for WaitForLine<P>where
P: RefUnwindSafe,
impl<P> Send for WaitForLine<P>where
P: Send,
impl<P> Sync for WaitForLine<P>where
P: Sync,
impl<P> Unpin for WaitForLine<P>where
P: Unpin,
impl<P> UnsafeUnpin for WaitForLine<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for WaitForLine<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