Run

Struct Run 

Source
pub struct Run { /* private fields */ }
Expand description

Holds access information for the file and provides access to it.

Implementations§

Source§

impl Run

Source

pub fn idx(&self) -> usize

Source

pub fn number_of_laps(&self) -> usize

Source

pub fn number_of_channels(&self) -> usize

Source

pub fn channels_count(&self) -> usize

Source

pub fn gps_channels_count(&self) -> usize

Source

pub fn gps_raw_channels_count(&self) -> usize

Source§

impl Run

Source

pub fn path(&self) -> &PathBuf

Source

pub fn info_of_laps(&self) -> &Vec<LapInfo>

Source

pub fn channel_names(&self) -> &Vec<String>

Source

pub fn channel_units(&self) -> &Vec<String>

Source§

impl Run

Source

pub fn library_date() -> Result<NaiveDate>

Library compilation date.

Source

pub fn library_time() -> Result<NaiveTime>

Library compilation time.

Source

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.

Source

pub fn load(path: &Path) -> Result<Arc<Self>>

Loads a drk/xrk file and creates an Run object.

Source

pub fn championship(&self) -> Result<String>

Source

pub fn track(&self) -> Result<String>

Source

pub fn venue_type(&self) -> Result<String>

Source

pub fn vehicle(&self) -> Result<String>

Source

pub fn racer(&self) -> Result<String>

Source

pub fn datetime(&self) -> Result<NaiveDateTime>

On success, the Result contains a datetime object which defines when this Run was recorded.

Source

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).

Source

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.

Source

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 Laps.

Source

pub fn channel_name(&self, channel_idx: usize) -> Result<String>

For channel with index idx, request the channel name.

Source

pub fn channel_idx(&self, channel_name: &str) -> Result<usize>

Request index of channel with name channel_name.

Source

pub fn channel_unit(&self, channel_idx: usize) -> Result<String>

For channel with index channel_idx, request the channel unit.

Source

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.

Source

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.

Source

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.

Source

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>).

Source

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.

Source

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>).

Source

pub fn gps_channel_name(&self, channel_idx: usize) -> Result<String>

For GPS channel with index channel_idx, request the channel name.

Source

pub fn gps_channel_unit(&self, channel_idx: usize) -> Result<String>

For GPS channel with index channel_idx, request the GPS channel unit.

Source

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.

Source

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>).

Source

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.

Source

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>).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Run

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Run

Source§

fn drop(&mut self)

Close the drk/xrk file on Run destruction

Source§

impl PartialEq for Run

Source§

fn eq(&self, other: &Run) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Run

Auto Trait Implementations§

§

impl Freeze for Run

§

impl RefUnwindSafe for Run

§

impl Send for Run

§

impl Sync for Run

§

impl Unpin for Run

§

impl UnwindSafe for Run

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.