#[non_exhaustive]pub struct F1PacketHeader {
pub packet_format: u16,
pub game_year: u8,
pub game_major_version: u8,
pub game_minor_version: u8,
pub packet_version: u8,
pub packet_id: PacketId,
pub session_uid: u64,
pub session_time: f32,
pub frame_identifier: u32,
pub overall_frame_identifier: u32,
pub player_car_index: usize,
pub secondary_player_car_index: usize,
}Expand description
F1 game packet’s header. It contains metadata about the game, the ongoing session, the frame this packet was sent on, and player car indexes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.packet_format: u16Value of the “UDP Format” option in the game’s telemetry settings.
This crate currently supports formats in range (2022..=2024).
game_year: u8Game year (last two digits). Available from the 2023 format onwards.
game_major_version: u8Game’s major version - “X.00”.
game_minor_version: u8Game’s minor version - “1.XX”.
packet_version: u8Version of this packet type, all start from 1.
packet_id: PacketIdUnique identifier for the packet type.
session_uid: u64Unique identifier for the session.
session_time: f32Session timestamp.
frame_identifier: u32Identifier for the frame the data was retrieved on. Goes back after a flashback is triggered.
overall_frame_identifier: u32Overall identifier for the frame the data was retrieved on (i.e. it doesn’t go back after flashbacks). Available from the 2023 format onwards.
player_car_index: usizeIndex of player 1’s car (255 if in spectator mode).
secondary_player_car_index: usizeIndex of player 2’s car in splitscreen mode. Set to 255 if not in splitscreen mode.
Trait Implementations§
Source§impl BinRead for F1PacketHeader
impl BinRead for F1PacketHeader
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>
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>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for F1PacketHeader
impl Clone for F1PacketHeader
Source§fn clone(&self) -> F1PacketHeader
fn clone(&self) -> F1PacketHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more