Crate igc_parser
source ·Expand description
§IGC Parser
A high-level parsing crate for IGC flight recorder files.
With most focus on:
- Easy to use
- No run-time asserts meaning that any errors will be through the
Result
type - A panic free crate
You should use this crate if you want to easily, quickly and safely parse igc files.
Look in records
to see the different kind of records that can be parsed
§examples
This is if you want all fixes that have parsed correctly. A similar approach is used for the other records.
use std::fs;
use igc_parser::records::{fix::Fix, Record};
let file = fs::read_to_string("./examples/example.igc").unwrap().parse::<String>().unwrap();
let valid_fixes = file.lines().filter_map(|line| {
match Record::parse(line) {
Ok(Record::B(fix)) => Some(fix),
_ => None,
}
}).collect::<Vec<Fix>>();
println!("{}", valid_fixes.len())
Modules§
- Parsing errors
- For parsing entire file at once
- Builder for a parser to parse only specific kinds of records
- All different type of IGC records