Telemetry

Struct Telemetry 

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

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.

Implementations§

Source§

impl Telemetry

Source

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

Constructs a new Telemetry.

Source§

impl Telemetry

Source

pub fn speed(&self) -> u16

Returns the speed of the car in kilometers per hour.

Source

pub fn throttle(&self) -> f32

Returns the ratio of the applied throttle.

Source

pub fn steering(&self) -> f32

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.

Source

pub fn brake(&self) -> f32

Returns the ratio of brake applied.

Source

pub fn clutch(&self) -> u8

Returns the percentage that the clutch has been applied.

Source

pub fn gear(&self) -> Gear

Returns the gear the car is in.

Source

pub fn engine_rpm(&self) -> u16

Returns the engine RPM.

Source

pub fn drs(&self) -> bool

Returns whether the DRS is deployed.

Source

pub fn rev_lights(&self) -> u8

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

Source

pub fn engine_temperature(&self) -> u16

Returns the engine temperature in degrees celsius.

Source§

impl Telemetry

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Trait Implementations§

Source§

impl Clone for Telemetry

Source§

fn clone(&self) -> Telemetry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Telemetry

Source§

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

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

impl Default for Telemetry

Source§

fn default() -> Telemetry

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Telemetry

Source§

fn eq(&self, other: &Telemetry) -> 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 PartialOrd for Telemetry

Source§

fn partial_cmp(&self, other: &Telemetry) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Telemetry

Source§

impl StructuralPartialEq for Telemetry

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.