[][src]Struct f1_api::packet::telemetry::Telemetry

pub struct Telemetry { /* fields omitted */ }

Telemetry data coming from a car

The telemetry data provided from the F1 games contains detailed, and quickly changing data on the inner mechanics of each car, e.g. its speed, engine RPMs, and temperatures.

Methods

impl Telemetry[src]

pub fn new(
    speed: u16,
    throttle: f32,
    steering: f32,
    brake: f32,
    clutch: u8,
    gear: Gear,
    engine_rpm: u16,
    drs: bool,
    rev_lights: u8,
    brake_temperature: CornerProperty<u16>,
    tyre_surface_temperature: CornerProperty<u16>,
    tyre_inner_temperature: CornerProperty<u16>,
    engine_temperature: u16,
    tyre_pressure: CornerProperty<f32>,
    surface_type: CornerProperty<Surface>
) -> Self
[src]

Constructs a new Telemetry.

impl Telemetry[src]

pub fn speed(&self) -> u16[src]

Returns the speed of the car in kilometers per hour.

pub fn throttle(&self) -> f32[src]

Returns the ratio of the applied throttle.

pub fn steering(&self) -> f32[src]

Returns the ratio of steering input.

The values range from -1.0 for a full lock left to 1.0 for a full lock right.

pub fn brake(&self) -> f32[src]

Returns the ratio of brake applied.

pub fn clutch(&self) -> u8[src]

Returns the percentage that the clutch has been applied.

pub fn gear(&self) -> Gear[src]

Returns the gear the car is in.

pub fn engine_rpm(&self) -> u16[src]

Returns the engine RPM.

pub fn drs(&self) -> bool[src]

Returns whether the DRS is deployed.

pub fn rev_lights(&self) -> u8[src]

Returns the percentage of how far the rev lights indicator is engaged.

pub fn engine_temperature(&self) -> u16[src]

Returns the engine temperature in degrees celsius.

impl Telemetry[src]

pub fn brake_temperature(&self) -> &CornerProperty<u16>[src]

Returns the brake temperature at each corner of the in degrees celsius.

pub fn tyre_surface_temperature(&self) -> &CornerProperty<u16>[src]

Returns the tyre surface temperature at each corner of the car in degrees celsius.

pub fn tyre_inner_temperature(&self) -> &CornerProperty<u16>[src]

Returns the tyre inner temperature at each corner of the car in degrees celsius.

pub fn tyre_pressure(&self) -> &CornerProperty<f32>[src]

Returns the tyre pressure at each corner of the car in psi.

pub fn surface_type(&self) -> &CornerProperty<Surface>[src]

Returns the type of the surface each tyre fo the car has contact with.

Trait Implementations

impl Clone for Telemetry[src]

impl Copy for Telemetry[src]

impl Debug for Telemetry[src]

impl Default for Telemetry[src]

impl PartialEq<Telemetry> for Telemetry[src]

impl PartialOrd<Telemetry> for Telemetry[src]

impl StructuralPartialEq for Telemetry[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.