[][src]Struct f1_api::packet::event::RaceWinner

pub struct RaceWinner { /* fields omitted */ }

Payload for the race winner event

The event announcing the race winner carries the vehicle index of the winner as its payload.

Examples

// Simplified use in a match statement
match event {
    Event::RaceWinner(winner) => {
        assert_eq!(0, winner.vehicle_index());
    }
}

Methods

impl RaceWinner[src]

pub fn new(vehicle_index: VehicleIndex) -> Self[src]

Constructs a new RaceWinner.

impl RaceWinner[src]

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

Returns the index of the car that has won the race.

Trait Implementations

impl Clone for RaceWinner[src]

impl Copy for RaceWinner[src]

impl Debug for RaceWinner[src]

impl Default for RaceWinner[src]

impl Display for RaceWinner[src]

impl Eq for RaceWinner[src]

impl Hash for RaceWinner[src]

impl Ord for RaceWinner[src]

impl PartialEq<RaceWinner> for RaceWinner[src]

impl PartialOrd<RaceWinner> for RaceWinner[src]

impl StructuralEq for RaceWinner[src]

impl StructuralPartialEq for RaceWinner[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> ToString for T where
    T: Display + ?Sized
[src]

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.