Training Center XML (TCX) parser written in Rust. It builds on Rust's serde deserialization framework.
```rust extern crate tcx;
use std::io::BufReader; use std::fs::File;
fn main() { let file = File::open("tests/20210119rungarmin_fenix6.tcx").unwrap(); let mut reader = std::io::BufReader::new(file); let result = crate::tcx::read(&mut reader); let activities = result.activities.unwrap();
for activity in activities.activities {
for lap in activity.laps {
for track in lap.tracks {
for trackpoint in track.trackpoints {
...
}
}
}
}
} ```
It is currently able to parse several example TCX files, specifically ones for running and cycling activities, but does not implement the entire specification.
This project is licensed under the MIT license.