Crate gchemol_parser
source · [−]Expand description
Text Reader for large text file.
Example
use gchemol_parser::TextReader;
let mut reader = TextReader::try_from_path("./tests/files/ch3f.mol2".as_ref()).unwrap();
// read a line into `s`
let mut s = String::new();
reader.read_line(&mut s).unwrap();
// seek a specific line
let _ = reader.seek_line(|line| line.starts_with("@<TRIPOS>")).unwrap();
// split remaining text into chunks (each chunk has 5 lines)
let chunks = reader.chunks(5);
for x in chunks {
// call nom parser to parse each chunk
dbg!(x);
}
Modules
Selected nom parser combinators (complete version, no streaming)
Split large text stream into multiple parts.
Macros
Structs
Quick grep text by marking the line that matching a pattern
A stream reader for large text file
A simple text view for quick peeking part of text