pub struct Run { /* private fields */ }
Expand description
Holds access information for the file and provides access to it.
Implementations
sourceimpl Run
impl Run
pub fn idx(&self) -> usize
pub fn number_of_laps(&self) -> usize
pub fn number_of_channels(&self) -> usize
pub fn channels_count(&self) -> usize
pub fn gps_channels_count(&self) -> usize
pub fn gps_raw_channels_count(&self) -> usize
sourceimpl Run
impl Run
pub fn path(&self) -> &PathBuf
pub fn info_of_laps(&self) -> &Vec<LapInfo>
pub fn channel_names(&self) -> &Vec<String>
pub fn channel_units(&self) -> &Vec<String>
sourceimpl Run
impl Run
sourcepub fn library_date() -> Result<NaiveDate>
pub fn library_date() -> Result<NaiveDate>
Library compilation date.
sourcepub fn library_time() -> Result<NaiveTime>
pub fn library_time() -> Result<NaiveTime>
Library compilation time.
sourcepub fn library_datetime() -> Result<NaiveDateTime>
pub fn library_datetime() -> Result<NaiveDateTime>
Library compilation date and time.
This is a convenience function wrapping the functions library_date
and
library_time
to produce a datetime object.
pub fn championship(&self) -> Result<String>
pub fn track(&self) -> Result<String>
pub fn venue_type(&self) -> Result<String>
pub fn vehicle(&self) -> Result<String>
pub fn racer(&self) -> Result<String>
sourcepub fn datetime(&self) -> Result<NaiveDateTime>
pub fn datetime(&self) -> Result<NaiveDateTime>
On success, the Result
contains a datetime object which defines when
this Run
was recorded.
sourcepub fn lap_info(&self, lap_idx: usize) -> Result<LapInfo>
pub fn lap_info(&self, lap_idx: usize) -> Result<LapInfo>
For lap with index lap_idx
, request LapInfo
. Returns an error if
lap_idx
is out of range (i.e. the Run
does not contain a lap
with that index) or the library calls fails for any reason.
LapInfo
objects contain the lap number, the start of the lap within the
run recorded in this file (via the start()
getter) and the lap duration
(via the duration()
getter).
sourcepub fn lap(&self, lap_idx: usize) -> Result<Lap>
pub fn lap(&self, lap_idx: usize) -> Result<Lap>
For lap with index idx
, request all channels. Returns a Lap object or
an error if idx
is out of range (i.e. the Run
does not contain a
lap with that index) or the library call fails for any reason.
Lap
objects contain a LapInfo
object and a Vec<Channel>
containing
all data recorded in the lap.
sourcepub fn all_laps(&self) -> Result<Vec<Lap>>
pub fn all_laps(&self) -> Result<Vec<Lap>>
Request all channels for all laps contained in this Run
. Fails if
the library call fails for any reason, either on finding all laps or on
requesting Lap
s.
sourcepub fn channel_name(&self, channel_idx: usize) -> Result<String>
pub fn channel_name(&self, channel_idx: usize) -> Result<String>
For channel with index idx
, request the channel name.
sourcepub fn channel_idx(&self, channel_name: &str) -> Result<usize>
pub fn channel_idx(&self, channel_name: &str) -> Result<usize>
Request index of channel with name channel_name
.
sourcepub fn channel_unit(&self, channel_idx: usize) -> Result<String>
pub fn channel_unit(&self, channel_idx: usize) -> Result<String>
For channel with index channel_idx
, request the channel unit.
sourcepub fn channel(
&self,
channel_idx: usize,
lap_idx: Option<usize>
) -> Result<Channel>
pub fn channel(
&self,
channel_idx: usize,
lap_idx: Option<usize>
) -> Result<Channel>
Request a Channel
object by name and lap index. Fails if no channel
with that name exists, if no lap with that index exists or the library
call fails for any reason. Pass None
for lap to get the raw channel
with data from all laps.
sourcepub fn channel_data(
&self,
channel_idx: usize,
lap_idx: Option<usize>
) -> Result<ChannelData>
pub fn channel_data(
&self,
channel_idx: usize,
lap_idx: Option<usize>
) -> Result<ChannelData>
For channel with id channel_id
, collect the measurement samples in a
ChannelData
object. GPS data included.
sourcepub fn channel_samples_count(&self, channel_idx: usize) -> Result<usize>
pub fn channel_samples_count(&self, channel_idx: usize) -> Result<usize>
For channel with index channel_idx
, request the number of samples
contained in this Run
.
sourcepub fn channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
pub fn channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
For channel with index channel_idx
, request the samples contained in
this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
sourcepub fn lap_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
pub fn lap_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
For lap with index lap_idx
and channel with index channel_idx
,
request the number of samples contained in this Run
.
sourcepub fn lap_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
pub fn lap_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
For lap with index lap_idx
and channel with index channel_idx
,
request the samples contained in this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
sourcepub fn gps_channel_name(&self, channel_idx: usize) -> Result<String>
pub fn gps_channel_name(&self, channel_idx: usize) -> Result<String>
For GPS channel with index channel_idx
, request the channel name.
sourcepub fn gps_channel_unit(&self, channel_idx: usize) -> Result<String>
pub fn gps_channel_unit(&self, channel_idx: usize) -> Result<String>
For GPS channel with index channel_idx
, request the GPS channel unit.
sourcepub fn gps_channel_samples_count(&self, channel_idx: usize) -> Result<usize>
pub fn gps_channel_samples_count(&self, channel_idx: usize) -> Result<usize>
For GPS channel with index channel_idx
, request the number of samples
contained in this Run
.
sourcepub fn gps_channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
pub fn gps_channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
For GPS channel with index channel_idx
, request the samples contained
in this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
sourcepub fn lap_gps_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
pub fn lap_gps_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
For lap with index lap_idx
and GPS channel with index channel_idx
,
request the number of samples contained in this Run
.
sourcepub fn lap_gps_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
pub fn lap_gps_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
For lap with index lap_idx
and GPS channel with index channel_idx
,
request the samples contained in this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
sourcepub fn gps_raw_channel_name(&self, channel_idx: usize) -> Result<String>
pub fn gps_raw_channel_name(&self, channel_idx: usize) -> Result<String>
For GPS raw channel with index channel_idx
, request the channel name.
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.
sourcepub fn gps_raw_channel_unit(&self, channel_idx: usize) -> Result<String>
pub fn gps_raw_channel_unit(&self, channel_idx: usize) -> Result<String>
For GPS raw channel with index channel_idx
, request the GPS channel
unit.
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.
sourcepub fn gps_raw_channel_samples_count(&self, channel_idx: usize) -> Result<usize>
pub fn gps_raw_channel_samples_count(&self, channel_idx: usize) -> Result<usize>
For GPS raw channel with index channel_idx
, request the number of
samples contained in this Run
.
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.
sourcepub fn gps_raw_channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
pub fn gps_raw_channel_samples(&self, channel_idx: usize) -> Result<ChannelData>
For GPS raw channel with index channel_idx
, request the samples
contained in this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.
sourcepub fn lap_gps_raw_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
pub fn lap_gps_raw_channel_samples_count(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<usize>
For lap with index lap_idx
and GPS raw channel with index
channel_idx
, request the number of samples contained in this
Run
.
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.
sourcepub fn lap_gps_raw_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
pub fn lap_gps_raw_channel_samples(
&self,
lap_idx: usize,
channel_idx: usize
) -> Result<ChannelData>
For lap with index lap_idx
and GPS raw channel with index
channel_idx
, request the samples contained in this Run
.
The data will be returned in the form of a ChannelData
object, which
contains the data as a set of timestamps (the timestamps()
getter
returns a &Vec<f64>
) and a corresponding set of samples (the
samples()
getter returns another &Vec<f64>
).
THIS SHOULD NEVER BE USED DIRECTLY AND IS ONLY PROVIDED AS AN INTERFACE TO THE UNDERLYING LIBRARY FUNCTION.