pub struct FastestLap { /* private fields */ }
Expand description
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());
}
}
Implementations§
Source§impl FastestLap
impl FastestLap
Sourcepub fn new(vehicle_index: VehicleIndex, time: Duration) -> Self
pub fn new(vehicle_index: VehicleIndex, time: Duration) -> Self
Constructs a new FastestLap
.
Source§impl FastestLap
impl FastestLap
Sourcepub fn vehicle_index(&self) -> VehicleIndex
pub fn vehicle_index(&self) -> VehicleIndex
Returns the index of the car achieving the fastest lap.
Trait Implementations§
Source§impl Clone for FastestLap
impl Clone for FastestLap
Source§fn clone(&self) -> FastestLap
fn clone(&self) -> FastestLap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FastestLap
impl Debug for FastestLap
Source§impl Default for FastestLap
impl Default for FastestLap
Source§fn default() -> FastestLap
fn default() -> FastestLap
Returns the “default value” for a type. Read more
Source§impl Display for FastestLap
impl Display for FastestLap
Source§impl Hash for FastestLap
impl Hash for FastestLap
Source§impl Ord for FastestLap
impl Ord for FastestLap
Source§fn cmp(&self, other: &FastestLap) -> Ordering
fn cmp(&self, other: &FastestLap) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FastestLap
impl PartialEq for FastestLap
Source§impl PartialOrd for FastestLap
impl PartialOrd for FastestLap
impl Copy for FastestLap
impl Eq for FastestLap
impl StructuralPartialEq for FastestLap
Auto Trait Implementations§
impl Freeze for FastestLap
impl RefUnwindSafe for FastestLap
impl Send for FastestLap
impl Sync for FastestLap
impl Unpin for FastestLap
impl UnwindSafe for FastestLap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more