pub struct Combo { /* private fields */ }Expand description
Represents a valid character and vehicle combination from a Mario Kart Wii RKG ghost file.
A combo is only valid when the character and vehicle share the same weight_class::WeightClass.
Construction via Combo::new enforces this constraint.
Implementations§
Source§impl Combo
impl Combo
pub const fn get_transmission(&self) -> Transmission
Source§impl Combo
impl Combo
Sourcepub fn new(vehicle: Vehicle, character: Character) -> Result<Self, ComboError>
pub fn new(vehicle: Vehicle, character: Character) -> Result<Self, ComboError>
Creates a new Combo from a vehicle and character.
§Errors
Returns ComboError::IncongruentWeightClasses if the character and vehicle
do not share the same WeightClass.
Trait Implementations§
Source§impl Display for Combo
Formats the combo as "{character} on {vehicle}" (e.g. "Mario on Mach Bike").
impl Display for Combo
Formats the combo as "{character} on {vehicle}" (e.g. "Mario on Mach Bike").
Source§impl GetWeightClass for Combo
Returns the weight class of the combo, which is always equal to both the
character’s and vehicle’s weight class (enforced at construction time).
impl GetWeightClass for Combo
Returns the weight class of the combo, which is always equal to both the character’s and vehicle’s weight class (enforced at construction time).
Source§fn get_weight_class(&self) -> WeightClass
fn get_weight_class(&self) -> WeightClass
Returns the weight class of this character, vehicle, or combo.
Auto Trait Implementations§
impl Freeze for Combo
impl RefUnwindSafe for Combo
impl Send for Combo
impl Sync for Combo
impl Unpin for Combo
impl UnsafeUnpin for Combo
impl UnwindSafe for Combo
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