[][src]Struct f1_api::packet::participants::ParticipantsPacket

pub struct ParticipantsPacket { /* fields omitted */ }

Packet containing information about each participant in the session

The F1 games provide information about each participant in a session, for example their name, team, and nationality. The data is updated every 5 seconds.

Methods

impl ParticipantsPacket[src]

pub fn new(
    header: Header,
    active_participants_count: u8,
    participants: Vec<Participant>
) -> Self
[src]

Constructs a new ParticipantsPacket.

impl ParticipantsPacket[src]

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

Returns the number of active participant in the session.

The number of active participants in the packet should match the number of cars on the HUD in-game.

impl ParticipantsPacket[src]

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

Returns the packet header prefixing the participants packet.

pub fn participants(&self) -> &Vec<Participant>[src]

Returns the participants in the session.

As is the case in other packets, the participants packet always contain 20 entries. This is also the case when there are less then 20 active participants in the session.

Trait Implementations

impl Clone for ParticipantsPacket[src]

impl Debug for ParticipantsPacket[src]

impl Eq for ParticipantsPacket[src]

impl Hash for ParticipantsPacket[src]

impl Ord for ParticipantsPacket[src]

impl PartialEq<ParticipantsPacket> for ParticipantsPacket[src]

impl PartialOrd<ParticipantsPacket> for ParticipantsPacket[src]

impl StructuralEq for ParticipantsPacket[src]

impl StructuralPartialEq for ParticipantsPacket[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.