Crates.io | fitparse |
lib.rs | fitparse |
version | 0.1.0 |
source | src |
created_at | 2020-07-14 11:59:25.758205 |
updated_at | 2020-07-14 11:59:25.758205 |
description | Rust library for parsing files in Garmin FIT format |
homepage | |
repository | https://github.com/djk121/fitparse |
max_upload_size | |
id | 265026 |
size | 2,504,309 |
Fitparse is a Rust library which implements a parser for Garmin's FIT file format.
use fitparse::fitfile::FitFile;
let mut f = match File::open("/path/to/fit_file.fit").unwrap();
let mut fit_file = FitFile::new(
1024 * 1024 * 10, // maximum file size, here 10 Mb
true // retain the raw bytes for per-message inspection
);
match ff.parse(&mut f) {
Err(e) => panic!("failed to parse file: {:?}", e),
_ => (),
}
println!("Parsed num messages: {}", ff.messages.len());
println!("Message #42:");
println!("{}", ff.messages[42]);