pub trait LineStream<'a> {
// Required methods
fn next_line(&mut self) -> Option<&'a str>;
fn peek_line(&mut self) -> Option<&'a str>;
// Provided methods
fn remainder_is_whitespace(&mut self) -> bool { ... }
fn blank_opens_velocity_block(&mut self) -> bool { ... }
fn next_coord_row(
&mut self,
spec_version: u32,
default_id: u64,
) -> Result<([f64; 3], [bool; 3], u64), ParseError> { ... }
}Expand description
Line source with peek for section detection (blank-line separators).
Implemented by the memchr cursor on the hot iterator path and by
Peekable<I> for tests / ad-hoc callers.
Required Methods§
Provided Methods§
Sourcefn remainder_is_whitespace(&mut self) -> bool
fn remainder_is_whitespace(&mut self) -> bool
True when every remaining line, including the current peek, is empty or whitespace. Default is false so a one-line peek cannot hide a following section.
Sourcefn blank_opens_velocity_block(&mut self) -> bool
fn blank_opens_velocity_block(&mut self) -> bool
With a blank line peeked, true unless the stream can see that the
line two past the blank is not a Velocities of Component label.
Default is true, which keeps the legacy blank-separator rule.
Sourcefn next_coord_row(
&mut self,
spec_version: u32,
default_id: u64,
) -> Result<([f64; 3], [bool; 3], u64), ParseError>
fn next_coord_row( &mut self, spec_version: u32, default_id: u64, ) -> Result<([f64; 3], [bool; 3], u64), ParseError>
One coordinate row, fused with the line scan when the stream can do it.
The default pulls a &str line. crate::iterators::MemchrLines
parses the row directly from the byte cursor so tokenize and numeric
parse are one pass.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".