Struct LapData

Source
#[non_exhaustive]
pub struct LapData {
Show 33 fields pub last_lap_time_ms: u32, pub current_lap_time_ms: u32, pub sector1_time_ms_part: u16, pub sector1_time_minutes_part: u8, pub sector2_time_ms_part: u16, pub sector2_time_minutes_part: u8, pub delta_to_car_in_front_ms_part: u16, pub delta_to_car_in_front_minutes_part: u8, pub delta_to_race_leader_ms: u16, pub delta_to_race_leader_minutes_part: u8, pub lap_distance: f32, pub total_distance: f32, pub safety_car_delta: f32, pub car_position: u8, pub current_lap_num: u8, pub pit_status: PitStatus, pub num_pit_stops: u8, pub sector: Sector, pub current_lap_invalid: bool, pub penalties: u8, pub total_warnings: u8, pub corner_cutting_warnings: u8, pub num_unserved_drive_through_pens: u8, pub num_unserved_stop_go_pens: u8, pub grid_position: u8, pub driver_status: DriverStatus, pub result_status: ResultStatus, pub pit_lane_timer_active: bool, pub pit_lane_time_in_lane_ms: u16, pub pit_stop_timer_ms: u16, pub pit_stop_should_serve_pen: bool, pub speed_trap_fastest_speed: f32, pub speed_trap_fastest_lap: u8,
}
Expand description

Lap data for a car on track.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§last_lap_time_ms: u32

Last lap time in milliseconds.

§current_lap_time_ms: u32

Current lap time in milliseconds.

§sector1_time_ms_part: u16

Current sector 1 time millisecond part.

§sector1_time_minutes_part: u8

Sector 1 whole minute part. Available from the 2023 format onwards.

§sector2_time_ms_part: u16

Current sector 2 time millisecond part.

§sector2_time_minutes_part: u8

Sector 2 whole minute part. Available from the 2023 format onwards.

§delta_to_car_in_front_ms_part: u16

Time delta to car in front in milliseconds. Available from the 2023 format onwards.

§delta_to_car_in_front_minutes_part: u8

Time delta to car in front whole minute part. Available from the 2024 format onwards.

§delta_to_race_leader_ms: u16

Time delta to race leader in milliseconds. Available from the 2023 format onwards.

§delta_to_race_leader_minutes_part: u8

Time delta to car in front whole minute part. Available from the 2024 format onwards.

§lap_distance: f32

The distance the vehicle is around current lap in metres. It may be negative if the start/finish line hasn’t been crossed yet.

§total_distance: f32

The total distance the vehicle has gone around in this session in metres. It may be negative if the start/finish line hasn’t been crossed yet.

§safety_car_delta: f32

Delta for the safety car in seconds.

§car_position: u8

Car’s race position.

§current_lap_num: u8

Current lap number.

§pit_status: PitStatus

Car’s pit status.

§num_pit_stops: u8

Number of pit stops taken in this race.

§sector: Sector

Zero-based number of the sector the driver is currently going through.

§current_lap_invalid: bool

Whether the current lap is invalid.

§penalties: u8

Accumulated time penalties to be added in seconds.

§total_warnings: u8

Accumulated number of warnings issued.

§corner_cutting_warnings: u8

Accumulated number of corner cutting warnings issued. Available from the 2023 format onwards.

§num_unserved_drive_through_pens: u8

Number of unserved drive through penalties left to serve.

§num_unserved_stop_go_pens: u8

Number of unserved stop-go penalties left to serve.

§grid_position: u8

The grid position the vehicle started the race in.

§driver_status: DriverStatus

Status of the driver.

§result_status: ResultStatus

Status of the driver’s result.

§pit_lane_timer_active: bool

Whether the pit lane timer is active.

§pit_lane_time_in_lane_ms: u16

Current time spent in the pit lane in milliseconds.

§pit_stop_timer_ms: u16

Time of the actual pit stop in milliseconds.

§pit_stop_should_serve_pen: bool

Whether the car should serve a penalty at this stop.

§speed_trap_fastest_speed: f32

Fastest speed through speed trap for this car in kilometres per hour. Available from the 2024 format onwards.

§speed_trap_fastest_lap: u8

Number of the lap the fastest speed was achieved on (255 means “not set”). Available from the 2024 format onwards.

Trait Implementations§

Source§

impl BinRead for LapData

Source§

type Args<'__binrw_generated_args_lifetime> = (u16,)

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>

Read Self from the reader using the given Endian and arguments. Read more
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments. Read more
Source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
Source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
Source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
Source§

fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian,

Read Self from the reader using the given arguments. Read more
Source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
Source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
Source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
Source§

impl Clone for LapData

Source§

fn clone(&self) -> LapData

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 LapData

Source§

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

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

impl<'de> Deserialize<'de> for LapData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for LapData

Source§

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

Source§

fn partial_cmp(&self, other: &LapData) -> 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 ReadEndian for LapData

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl Serialize for LapData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for LapData

Source§

impl StructuralPartialEq for LapData

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,