Struct F1Packet

Source
pub struct F1Packet {
Show 16 fields pub header: F1PacketHeader, pub motion: Option<F1PacketMotion>, pub session: Option<F1PacketSession>, pub laps: Option<F1PacketLaps>, pub event: Option<F1PacketEvent>, pub participants: Option<F1PacketParticipants>, pub car_setups: Option<F1PacketCarSetups>, pub car_telemetry: Option<F1PacketCarTelemetry>, pub car_status: Option<F1PacketCarStatus>, pub final_classification: Option<F1PacketFinalClassification>, pub lobby: Option<F1PacketLobby>, pub car_damage: Option<F1PacketCarDamage>, pub session_history: Option<F1PacketSessionHistory>, pub tyre_sets: Option<F1PacketTyreSets>, pub motion_ex: Option<F1PacketMotionEx>, pub time_trial: Option<F1PacketTimeTrial>,
}
Expand description

Structured representation of raw F1 game packet data that’s returned as a successful result of the parse function.

Each Option field acts as a slot for a payload of a packet of a certain type. Only one of these fields can be Some for a given F1Packet instance.

Fields§

§header: F1PacketHeader

Universal packet header.

§motion: Option<F1PacketMotion>

Physics data for all cars in the ongoing session.

§session: Option<F1PacketSession>

Data about the ongoing session.

§laps: Option<F1PacketLaps>

Lap data for all cars on track.

§event: Option<F1PacketEvent>

Details of events that happen during the course of the ongoing session.

§participants: Option<F1PacketParticipants>

List of participants in the session.

§car_setups: Option<F1PacketCarSetups>

Setup data for all cars in the ongoing session.

§car_telemetry: Option<F1PacketCarTelemetry>

Telemetry data for all cars in the ongoing session.

§car_status: Option<F1PacketCarStatus>

Status data for all cars in the ongoing session.

§final_classification: Option<F1PacketFinalClassification>

Final classification confirmation at the end of the session.

§lobby: Option<F1PacketLobby>

Details of players in a multiplayer lobby.

§car_damage: Option<F1PacketCarDamage>

Car damage parameters for all cars in the ongoing session.

§session_history: Option<F1PacketSessionHistory>

Session history data for a specific car.

§tyre_sets: Option<F1PacketTyreSets>

Details of tyre sets assigned to a vehicle during the session. Available from the 2023 format onwards.

§motion_ex: Option<F1PacketMotionEx>

Extended player car only motion data. Available from the 2023 format onwards.

§time_trial: Option<F1PacketTimeTrial>

Extra information that’s only relevant to the time trial game mode. Available from the 2024 format onwards.

Trait Implementations§

Source§

impl BinRead for F1Packet

Source§

type Args<'__binrw_generated_args_lifetime> = ()

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 F1Packet

Source§

fn clone(&self) -> F1Packet

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 F1Packet

Source§

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

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

impl<'de> Deserialize<'de> for F1Packet

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 F1Packet

Source§

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

Source§

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

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl Serialize for F1Packet

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 StructuralPartialEq for F1Packet

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>,