Open dbrgn opened 5 years ago
it is certainly possible to build a parser on top of this library that implements that, but I'm not sure if igc-rs
should provide that by itself. we currently use lifetime annotations in a lot of places to avoid unnecessary memory copies, but when parsing a whole life that gets a lot more tricky. you would need to read the whole file in memory first, but then the advantage of std::io::Read
is gone.
a parser that reads complete files also might want to task the I/J records into account a little better than what we do here so far, and couldn't be stateless due to that.
That's true, and I only realized the difficulty with the lifetimes once I ran into that myself :slightly_smiling_face:
Maybe the goal of the library should be re-worded to "This crate provides a minimal, fast parser for IGC records".
The docs state:
But from the docs, it also seems that it only provides a line/record parser. Or did I overlook something?
I'm aware that I can parse a file by mapping the parsing function on a line iterator, but it would be cool if there were a function to do that in this library (e.g. a parser that can process any type that implements
std::io::Read
). What do you think?