Struct F1PacketSession

Source
#[non_exhaustive]
pub struct F1PacketSession {
Show 77 fields pub weather: Weather, pub track_temperature: i8, pub air_temperature: i8, pub total_laps: u8, pub track_length: u16, pub session_type: u8, pub track_id: TrackId, pub formula: Formula, pub session_time_left: u16, pub session_duration: u16, pub pit_speed_limit: u8, pub game_paused: bool, pub is_spectating: bool, pub spectator_car_index: usize, pub sli_pro_native_support: bool, pub num_marshal_zones: usize, pub marshal_zones: Vec<MarshalZone>, pub safety_car_status: SafetyCarStatus, pub network_game: bool, pub num_weather_forecast_samples: usize, pub weather_forecast_samples: Vec<WeatherForecastSample>, pub forecast_accuracy: ForecastAccuracy, pub ai_difficulty: u8, pub season_link_identifier: u32, pub weekend_link_identifier: u32, pub session_link_identifier: u32, pub pit_stop_window_ideal_lap: u8, pub pit_stop_window_latest_lap: u8, pub pit_stop_rejoin_position: u8, pub steering_assist: bool, pub braking_assist: BrakingAssist, pub gearbox_assist: GearboxAssist, pub pit_assist: bool, pub pit_release_assist: bool, pub ers_assist: bool, pub drs_assist: bool, pub dynamic_racing_line: DynamicRacingLine, pub dynamic_racing_line_type: DynamicRacingLineType, pub game_mode: GameMode, pub rule_set: RuleSet, pub time_of_day: u32, pub session_length: SessionLength, pub speed_unit_lead_player: Option<SpeedUnit>, pub temperature_unit_lead_player: Option<TemperatureUnit>, pub speed_unit_secondary_player: Option<SpeedUnit>, pub temperature_unit_secondary_player: Option<TemperatureUnit>, pub num_safety_car_periods: u8, pub num_virtual_safety_car_periods: u8, pub num_red_flag_periods: u8, pub equal_car_performance: bool, pub recovery_mode: Option<RecoveryMode>, pub flashback_limit: Option<FlashbackLimit>, pub surface_sim_type: Option<SurfaceSimType>, pub low_fuel_mode: Option<LowFuelMode>, pub race_starts: Option<RaceStarts>, pub tyre_temperature: Option<TyreTemperature>, pub pit_lane_tyre_sim: bool, pub car_damage: Option<CarDamage>, pub car_damage_rate: Option<CarDamageRate>, pub collisions: Option<Collisions>, pub collisions_off_for_first_lap_only: bool, pub mp_unsafe_pit_release_disabled: bool, pub mp_collisions_off_for_griefing: bool, pub corner_cutting_stringency: Option<CornerCuttingStringency>, pub parc_ferme_rules: bool, pub pit_stop_experience: Option<PitStopExperience>, pub safety_car_intensity: Option<SafetyCarIntensity>, pub safety_car_experience: Option<SafetyCarExperience>, pub formation_lap: bool, pub formation_lap_experience: Option<FormationLapExperience>, pub red_flag_intensity: Option<RedFlagIntensity>, pub affects_license_level_solo: bool, pub affects_license_level_mp: bool, pub num_sessions_in_weekend: usize, pub weekend_structure: Vec<u8>, pub sector2_lap_distance_start: f32, pub sector3_lap_distance_start: f32,
}
Expand description

The session packet includes details about the current session in progress.

§Example

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.
§weather: Weather

Current weather.

§track_temperature: i8

Track temperature in degrees Celsius.

§air_temperature: i8

Air temperature in degrees Celsius.

§total_laps: u8

Total number of laps in this session.

§track_length: u16

Track’s length in metres.

§session_type: u8

Session’s type. See session_type for possible values.

§track_id: TrackId

Unique identifier of the track.

§formula: Formula

Formula of cars being raced.

§session_time_left: u16

Time left in the session in seconds.

§session_duration: u16

Session’s duration in seconds.

§pit_speed_limit: u8

Pit lane’s speed limit in kilometres per hour.

§game_paused: bool

Whether the game is paused.

§is_spectating: bool

Whether the player is spectating.

§spectator_car_index: usize

Index of the car being spectated.

§sli_pro_native_support: bool

Whether SLI Pro support is active.

§num_marshal_zones: usize

Number of marshal zones to follow.

§marshal_zones: Vec<MarshalZone>

List of marshal zones. Should have a size equal to num_marshal_zones.

§safety_car_status: SafetyCarStatus

Safety car deployment status.

§network_game: bool

Whether this game is online.

§num_weather_forecast_samples: usize

Number of weather samples to follow.

§weather_forecast_samples: Vec<WeatherForecastSample>

List of up to weather forecast samples. Should have a size equal to num_weather_forecast_samples.

§forecast_accuracy: ForecastAccuracy

Weather forecast accuracy.

§ai_difficulty: u8

AI difficulty rating in range (0..=110).

§season_link_identifier: u32

Identifier for season - persists across saves.

§weekend_link_identifier: u32

Identifier for weekend - persists across saves.

§session_link_identifier: u32

Identifier for session - persists across saves.

§pit_stop_window_ideal_lap: u8

Ideal lap for the player to pit on for current strategy.

§pit_stop_window_latest_lap: u8

The latest lap for the player to pit on for current strategy.

§pit_stop_rejoin_position: u8

Predicted position for the player to rejoin at.

§steering_assist: bool

Whether the steering assist is enabled.

§braking_assist: BrakingAssist

Type of braking assist enabled.

§gearbox_assist: GearboxAssist

Type of gearbox assist enabled.

§pit_assist: bool

Whether the pit assist is enabled.

§pit_release_assist: bool

Whether the pit release assist is enabled.

§ers_assist: bool

Whether the ERS assist is enabled.

§drs_assist: bool

Whether the DRS assist is enabled.

§dynamic_racing_line: DynamicRacingLine

Type of the dynamic racing line assist.

§dynamic_racing_line_type: DynamicRacingLineType

Type of the dynamic racing line (2D/3D).

§game_mode: GameMode

Game mode’s identifier.

§rule_set: RuleSet

Rule set’s identifier.

§time_of_day: u32

Local time of day as minutes since midnight.

§session_length: SessionLength

Session’s length.

§speed_unit_lead_player: Option<SpeedUnit>

Speed unit used by player 1. Available from the 2023 format onwards.

§temperature_unit_lead_player: Option<TemperatureUnit>

Temperature unit used by player 1. Available from the 2023 format onwards.

§speed_unit_secondary_player: Option<SpeedUnit>

Speed unit used by player 2. Available from the 2023 format onwards.

§temperature_unit_secondary_player: Option<TemperatureUnit>

Temperature unit used by player 2. Available from the 2023 format onwards.

§num_safety_car_periods: u8

Number of full safety cars called during the session. Available from the 2023 format onwards.

§num_virtual_safety_car_periods: u8

Number of virtual safety cars called during the session. Available from the 2023 format onwards.

§num_red_flag_periods: u8

Number of red flags called during the session. Available from the 2023 format onwards.

§equal_car_performance: bool

Whether equal car performance is enabled. Available from the 2024 format onwards.

§recovery_mode: Option<RecoveryMode>

Recovery mode assist. Available from the 2024 format onwards.

§flashback_limit: Option<FlashbackLimit>

Flashback limit type. Available from the 2024 format onwards.

§surface_sim_type: Option<SurfaceSimType>

Surface simulation type. Available from the 2024 format onwards.

§low_fuel_mode: Option<LowFuelMode>

Low fuel driving difficulty. Available from the 2024 format onwards.

§race_starts: Option<RaceStarts>

Race starts assist. Available from the 2024 format onwards.

§tyre_temperature: Option<TyreTemperature>

Tyre temperature simulation type. Available from the 2024 format onwards.

§pit_lane_tyre_sim: bool

Whether the pit lane tyre simulation (cold tyres and low grip right after a stop) is enabled. Available from the 2024 format onwards.

§car_damage: Option<CarDamage>

Car damage simulation type. Available from the 2024 format onwards.

§car_damage_rate: Option<CarDamageRate>

Car damage rate. Available from the 2024 format onwards.

§collisions: Option<Collisions>

Collision simulation type. Available from the 2024 format onwards.

§collisions_off_for_first_lap_only: bool

Whether collisions are disabled only for lap 1. Available from the 2024 format onwards.

§mp_unsafe_pit_release_disabled: bool

Whether unsafe pit release is disabled in a multiplayer game. Available from the 2024 format onwards.

§mp_collisions_off_for_griefing: bool

Whether collisions get disabled for griefing in a multiplayer game. Available from the 2024 format onwards.

§corner_cutting_stringency: Option<CornerCuttingStringency>

Corner cutting stringency. Available from the 2024 format onwards.

§parc_ferme_rules: bool

Whether parc fermé rules are enabled. Available from the 2024 format onwards.

§pit_stop_experience: Option<PitStopExperience>

Pit stop experience. Available from the 2024 format onwards.

§safety_car_intensity: Option<SafetyCarIntensity>

Safety car intensity. Available from the 2024 format onwards.

§safety_car_experience: Option<SafetyCarExperience>

Safety car experience. Available from the 2024 format onwards.

§formation_lap: bool

Whether formation lap is enabled. Available from the 2024 format onwards.

§formation_lap_experience: Option<FormationLapExperience>

Formation lap experience. Available from the 2024 format onwards.

§red_flag_intensity: Option<RedFlagIntensity>

Red flag intensity. Available from the 2024 format onwards.

§affects_license_level_solo: bool

Whether this single player game affects the license level. Available from the 2024 format onwards.

§affects_license_level_mp: bool

Whether this multiplayer game affects the license level. Available from the 2024 format onwards.

§num_sessions_in_weekend: usize

Number of sessions in the ongoing race weekend.

§weekend_structure: Vec<u8>

List of sessions that shows this weekend’s structure. Should have a size equal to num_sessions_in_weekend. See session_type for possible values. Available from the 2024 format onwards.

§sector2_lap_distance_start: f32

Distance (in metres) around the track where sector 2 starts. Available from the 2024 format onwards.

§sector3_lap_distance_start: f32

Distance (in metres) around the track where sector 3 starts. Available from the 2024 format onwards.

Trait Implementations§

Source§

impl BinRead for F1PacketSession

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 F1PacketSession

Source§

fn clone(&self) -> F1PacketSession

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 F1PacketSession

Source§

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

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

impl<'de> Deserialize<'de> for F1PacketSession

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 F1PacketSession

Source§

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

Source§

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

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl Serialize for F1PacketSession

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 F1PacketSession

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