pub struct Retirement { /* private fields */ }
Expand description
Payload for retirement event
The retirement event contains the vehicle index of the retired driver as its payload.
§Examples
// Simplified use in a match statement
match event {
Event::Retirement(retirement) => {
assert_eq!(0, retirement.vehicle_index());
}
}
Implementations§
Source§impl Retirement
impl Retirement
Sourcepub fn new(vehicle_index: VehicleIndex) -> Self
pub fn new(vehicle_index: VehicleIndex) -> Self
Constructs a new Retirement
.
Source§impl Retirement
impl Retirement
Sourcepub fn vehicle_index(&self) -> VehicleIndex
pub fn vehicle_index(&self) -> VehicleIndex
Returns the index of the car retiring.
Trait Implementations§
Source§impl Clone for Retirement
impl Clone for Retirement
Source§fn clone(&self) -> Retirement
fn clone(&self) -> Retirement
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 Retirement
impl Debug for Retirement
Source§impl Default for Retirement
impl Default for Retirement
Source§fn default() -> Retirement
fn default() -> Retirement
Returns the “default value” for a type. Read more
Source§impl Display for Retirement
impl Display for Retirement
Source§impl Hash for Retirement
impl Hash for Retirement
Source§impl Ord for Retirement
impl Ord for Retirement
Source§fn cmp(&self, other: &Retirement) -> Ordering
fn cmp(&self, other: &Retirement) -> 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 Retirement
impl PartialEq for Retirement
Source§impl PartialOrd for Retirement
impl PartialOrd for Retirement
impl Copy for Retirement
impl Eq for Retirement
impl StructuralPartialEq for Retirement
Auto Trait Implementations§
impl Freeze for Retirement
impl RefUnwindSafe for Retirement
impl Send for Retirement
impl Sync for Retirement
impl Unpin for Retirement
impl UnwindSafe for Retirement
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