Itelem
Provides parsing of iRacing's .ibt
telemetry files. It's based on the excellent javascript library ibt-telemetry.
Usage
To use itelem
, add the following to your Cargo.toml
:
[]
= "0.1"
or run this command in your project root:
$ cargo add itelem@0.1
Pass in a file or anything that implements Read + Seek
and you can access header information as well as weekend_info
and the samples that contain the most interesting information.
let file = open.unwrap;
let mut reader = new;
assert_eq!;
let weekend_info = &reader.session_info.weekend_info;
assert_eq!;
let rpm = reader.find_var.unwrap;
let samples: = reader.samples.collect;
// There are 3371 samples and with a 60 tick tick_rate
// meaning that the telemetry file contains 56 seconds of data
assert_eq!;
let first_sample = samples.get_by_header.unwrap;
assert_eq!;