Skip to main content

from_reader

Function from_reader 

Source
pub fn from_reader<R: Read>(reader: R) -> FromReaderIter<R> 
Expand description

Parse a reader into a lazy iterator of OwnedSegments.

Returns a FromReaderIter that parses and yields segments on demand, keeping memory bounded. Use from_reader_collect to eagerly materialise all segments into a Vec.

§Errors

Each next() call yields Some(Ok(segment)) for a successfully parsed segment, Some(Err(EdifactError)) for a parse or I/O failure, and None when the end of the stream has been reached.