[][src]Struct iracing::telemetry::Sample

pub struct Sample { /* fields omitted */ }

Sample represents a single sample of telemetry data from iRacing either from live telemetry, or from a telemetry file.

Implementations

impl Sample[src]

pub fn has(&self, name: &'static str) -> bool[src]

Check if a given variable is available in the telemetry sample

pub fn all(&self) -> Vec<ValueDescription>[src]

Gets all values in the same along with names and descriptions.

Returns a vec of all values in the telemetry sample, along with additional metadata such as the name, description, unit and value count.

Note: This method is expensive and will return a large number of values. It should be used primarily for debugging, and for most use cases Selecting only the values required with get() is suggested.

pub fn get(&self, name: &'static str) -> Result<Value, String>[src]

Get a Value from the sample.

Read a single varialbe from the telemetry sample.

Returns Ok(Value) if the telemetry value is available. Returns Err(String) if the value cannot be found.

Parameters

name Name of the telemetry variable to get

  • see the iRacing Telemtry documentation for a complete list of possible values

Trait Implementations

impl Debug for Sample[src]

impl Default for Sample[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.