pub struct LineProcessor<'a> { /* private fields */ }Expand description
Incremental line-by-line processor for streaming inputs (pipe mode).
Wraps the same per-line logic as apply without buffering the whole
input: feed lines in order (terminators stripped), emit what comes
back. Carries the stateful pieces — pattern-range filter, replacement
budget, line counter — across calls, so --range, --first-in-file,
and --max-replacements all work on streams.
Multiline operations need the whole buffer and are rejected at construction; callers fall back to buffered processing for those.
Implementations§
Source§impl<'a> LineProcessor<'a>
impl<'a> LineProcessor<'a>
pub fn new( op: &'a Op, matcher: &'a Matcher, range: Option<RangeSpec>, ) -> Result<Self, RipsedError>
Sourcepub fn process_line(&mut self, line: &str) -> StreamedLine
pub fn process_line(&mut self, line: &str) -> StreamedLine
Process the next input line (without its terminator).
Auto Trait Implementations§
impl<'a> Freeze for LineProcessor<'a>
impl<'a> RefUnwindSafe for LineProcessor<'a>
impl<'a> Send for LineProcessor<'a>
impl<'a> Sync for LineProcessor<'a>
impl<'a> Unpin for LineProcessor<'a>
impl<'a> UnsafeUnpin for LineProcessor<'a>
impl<'a> UnwindSafe for LineProcessor<'a>
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