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

pub struct FastestLap { /* fields omitted */ }

Payload for fastest lap event

The fastest lap event contains the driver achieving the fastest lap as well as the lap time as its payload. The driver is referenced through the vehicle index, while the lap time is provided in seconds.

Examples

// Simplified use in a match statement
match event {
    Event::FastestLap(lap) => {
        assert_eq!(0, lap.vehicle_index());
        assert_eq!(62, lap.time().as_secs());
    }
}

Methods

impl FastestLap[src]

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

Constructs a new FastestLap.

impl FastestLap[src]

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

Returns the time of the fastest lap.

impl FastestLap[src]

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

Returns the index of the car achieving the fastest lap.

Trait Implementations

impl Clone for FastestLap[src]

impl Copy for FastestLap[src]

impl Debug for FastestLap[src]

impl Default for FastestLap[src]

impl Display for FastestLap[src]

impl Eq for FastestLap[src]

impl Hash for FastestLap[src]

impl Ord for FastestLap[src]

impl PartialEq<FastestLap> for FastestLap[src]

impl PartialOrd<FastestLap> for FastestLap[src]

impl StructuralEq for FastestLap[src]

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