pub struct HeldStream { /* private fields */ }Expand description
A stream scanner and the bytes from its retained window on, with where they stand in the input: what a reader needs beside the scanner to read each committed match’s text and registers and to place it on its line.
The bytes a push settles are dropped at the next push, so the matches a
push commits are read against HeldStream::held until then.
Implementations§
Source§impl HeldStream
impl HeldStream
Sourcepub fn new(
scanner: StreamScanner,
origin: usize,
lines_before: Option<usize>,
) -> Self
pub fn new( scanner: StreamScanner, origin: usize, lines_before: Option<usize>, ) -> Self
scanner over an input whose first byte stands at origin, after
lines_before of its lines; the lines are counted on as the stream
moves where they were counted to its start, and left uncounted where
they were not.
Sourcepub fn commits_early(&self) -> bool
pub fn commits_early(&self) -> bool
Whether a match can commit before the input ends.
Sourcepub fn lines_before(&self) -> Option<usize>
pub fn lines_before(&self) -> Option<usize>
How many of the input’s lines come before the held bytes, where the stream counts them.
Sourcepub fn settled(&self) -> usize
pub fn settled(&self) -> usize
How much of the held bytes is final: no match can still begin before this offset into them, and every match that ends before it has been committed.