[][src]Struct f1_api::packet::session::SessionPacket

pub struct SessionPacket { /* fields omitted */ }

Packet containing data about the current session

The session packet provides information about the current session, for example weather and temperature as well as settings like the type of safety car in use.

Methods

impl SessionPacket[src]

pub fn new(
    header: Header,
    weather: Weather,
    track_temperature: i8,
    air_temperature: i8,
    total_laps: u8,
    track_length: u16,
    session_type: Session,
    track: Track,
    formula: Formula,
    time_left: Duration,
    duration: Duration,
    pit_speed_limit: u8,
    game_paused: bool,
    is_spectating: bool,
    spectator_car_index: VehicleIndex,
    sli_pro_support: bool,
    marshal_zones: Vec<MarshalZone>,
    safety_car: SafetyCar,
    network_session: bool
) -> Self
[src]

Constructs a new SessionPacket.

impl SessionPacket[src]

pub fn weather(&self) -> Weather[src]

Returns the current weather in the session.

pub fn track_temperature(&self) -> i8[src]

Returns the track temperature in degrees celsius.

pub fn air_temperature(&self) -> i8[src]

Returns the air temperature in degrees celsius.

pub fn total_laps(&self) -> u8[src]

Returns the total number of laps in this race.

pub fn track_length(&self) -> u16[src]

Returns the length of the race track in metres.

pub fn session_type(&self) -> Session[src]

Returns the type of the current session.

pub fn track(&self) -> Track[src]

Returns the race track of the session.

pub fn formula(&self) -> Formula[src]

Returns the type of formula racing.

pub fn pit_speed_limit(&self) -> u8[src]

Returns the pit speed limit in kilometers per hour.

pub fn game_paused(&self) -> bool[src]

Returns whether the game is paused right now.

pub fn is_spectating(&self) -> bool[src]

Returns whether the player is spectating the session.

pub fn spectator_car_index(&self) -> VehicleIndex[src]

Returns the index of the car being spectated.

pub fn sli_pro_support(&self) -> bool[src]

Returns whether the support for SLI Pro is active.

pub fn safety_car(&self) -> SafetyCar[src]

Returns the type of safety car that is used in the session.

pub fn network_session(&self) -> bool[src]

Returns whether the session is a multiplayer session.

impl SessionPacket[src]

pub fn header(&self) -> &Header[src]

Returns the packet header prefixing the session packet.

pub fn time_left(&self) -> &Duration[src]

Returns the time that is left in the session.

pub fn duration(&self) -> &Duration[src]

Returns the duration of the session in seconds.

pub fn marshal_zones(&self) -> &Vec<MarshalZone>[src]

Returns the marshal zones around the track.

Trait Implementations

impl Clone for SessionPacket[src]

impl Debug for SessionPacket[src]

impl PartialEq<SessionPacket> for SessionPacket[src]

impl PartialOrd<SessionPacket> for SessionPacket[src]

impl StructuralPartialEq for SessionPacket[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.