pub struct RaceWinner { /* private fields */ }Expand description
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());
}
}Implementations§
Source§impl RaceWinner
impl RaceWinner
Sourcepub fn new(vehicle_index: VehicleIndex) -> Self
pub fn new(vehicle_index: VehicleIndex) -> Self
Constructs a new RaceWinner.
Source§impl RaceWinner
impl RaceWinner
Sourcepub fn vehicle_index(&self) -> VehicleIndex
pub fn vehicle_index(&self) -> VehicleIndex
Returns the index of the car that has won the race.
Trait Implementations§
Source§impl Clone for RaceWinner
impl Clone for RaceWinner
Source§fn clone(&self) -> RaceWinner
fn clone(&self) -> RaceWinner
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 RaceWinner
impl Debug for RaceWinner
Source§impl Default for RaceWinner
impl Default for RaceWinner
Source§fn default() -> RaceWinner
fn default() -> RaceWinner
Returns the “default value” for a type. Read more
Source§impl Display for RaceWinner
impl Display for RaceWinner
Source§impl Hash for RaceWinner
impl Hash for RaceWinner
Source§impl Ord for RaceWinner
impl Ord for RaceWinner
Source§fn cmp(&self, other: &RaceWinner) -> Ordering
fn cmp(&self, other: &RaceWinner) -> 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 RaceWinner
impl PartialEq for RaceWinner
Source§impl PartialOrd for RaceWinner
impl PartialOrd for RaceWinner
impl Copy for RaceWinner
impl Eq for RaceWinner
impl StructuralPartialEq for RaceWinner
Auto Trait Implementations§
impl Freeze for RaceWinner
impl RefUnwindSafe for RaceWinner
impl Send for RaceWinner
impl Sync for RaceWinner
impl Unpin for RaceWinner
impl UnwindSafe for RaceWinner
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