#[non_exhaustive]pub struct Chassis {Show 13 fields
pub drag_coef: Ratio,
pub frontal_area: Area,
pub wheel_rr_coef: Ratio,
pub wheel_inertia: MomentOfInertia,
pub num_wheels: u8,
pub wheel_radius: Option<Length>,
pub tire_code: Option<String>,
pub cg_height: Length,
pub wheel_fric_coef: Ratio,
pub drive_type: DriveTypes,
pub drive_axle_weight_frac: Ratio,
pub wheel_base: Length,
pub cargo_mass: Option<Mass>,
/* private fields */
}Expand description
Struct for simulating vehicle
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.drag_coef: RatioAerodynamic drag coefficient
frontal_area: AreaProjected frontal area for drag calculations
wheel_rr_coef: RatioWheel rolling resistance coefficient for the vehicle (i.e. all wheels included)
wheel_inertia: MomentOfInertiaWheel inertia per wheel
num_wheels: u8Number of wheels
wheel_radius: Option<Length>Wheel radius
tire_code: Option<String>Tire code (optional method of calculating wheel radius)
cg_height: LengthVehicle center of mass height
wheel_fric_coef: RatioWheel coefficient of friction
drive_type: DriveTypesDrive wheel configuration
drive_axle_weight_frac: RatioFraction of vehicle weight on drive action when stationary
wheel_base: LengthWheel base length
cargo_mass: Option<Mass>Cargo mass including passengers
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chassis
impl<'de> Deserialize<'de> for Chassis
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Mass for Chassis
impl Mass for Chassis
Source§fn mass(&self) -> Result<Option<Mass>>
fn mass(&self) -> Result<Option<Mass>>
Returns mass of Self, either from
self.mass or
the derived from fields that store mass data. Mass::mass also checks that
derived mass, if Some, is same as self.mass.Source§fn set_mass(
&mut self,
new_mass: Option<Mass>,
_side_effect: MassSideEffect,
) -> Result<()>
fn set_mass( &mut self, new_mass: Option<Mass>, _side_effect: MassSideEffect, ) -> Result<()>
Sets component mass to
mass, or if None is provided for mass,
sets mass based on other component parameters (e.g. power and power
density, sum of fields containing mass)Source§fn derived_mass(&self) -> Result<Option<Mass>>
fn derived_mass(&self) -> Result<Option<Mass>>
Returns derived mass (e.g. sum of mass fields, or
calculation involving mass specific properties). If
Source§fn expunge_mass_fields(&mut self)
fn expunge_mass_fields(&mut self)
Sets all fields that are used in calculating derived mass to
None.
Does not touch self.mass.Source§fn set_mass_specific_property(&mut self) -> Result<()>
fn set_mass_specific_property(&mut self) -> Result<()>
Sets any mass-specific property with appropriate side effects
Source§impl SerdeAPI for Chassis
impl SerdeAPI for Chassis
const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _
const ACCEPTED_STR_FORMATS: &'static [&'static str] = _
const RESOURCES_DIR: &'static Dir<'_> = _
const RESOURCES_SUBDIR: &'static str = ""
Source§fn from_resource<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_resource<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
Read (deserialize) an object from a resource file packaged with the
fastsim-core crate Read moreSource§fn list_resources() -> Result<Vec<PathBuf>, Error>
fn list_resources() -> Result<Vec<PathBuf>, Error>
List the available resources in the resources directory Read more
Source§fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<(), Error>
fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<(), Error>
Write (serialize) an object to a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS.
Creates a new file if it does not already exist, otherwise truncates the existing file. Read moreSource§fn from_file<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_file<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
Read (deserialize) an object from a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS. Read moreSource§fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<(), Error>
fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<(), Error>
Write (serialize) an object into anything that implements
std::io::Write Read moreSource§fn from_reader<R: Read>(
rdr: &mut R,
format: &str,
skip_init: bool,
) -> Result<Self, Error>
fn from_reader<R: Read>( rdr: &mut R, format: &str, skip_init: bool, ) -> Result<Self, Error>
Deserialize an object from anything that implements
std::io::Read Read moreSource§fn to_str(&self, format: &str) -> Result<String>
fn to_str(&self, format: &str) -> Result<String>
Write (serialize) an object into a string Read more
Source§fn from_str<S: AsRef<str>>(
contents: S,
format: &str,
skip_init: bool,
) -> Result<Self>
fn from_str<S: AsRef<str>>( contents: S, format: &str, skip_init: bool, ) -> Result<Self>
Read (deserialize) an object from a string Read more
Source§fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
Read (deserialize) an object from a JSON string Read more
Source§fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
Read (deserialize) an object from a message pack Read more
Source§impl TryFrom<&RustVehicle> for Chassis
impl TryFrom<&RustVehicle> for Chassis
impl StructuralPartialEq for Chassis
Auto Trait Implementations§
impl Freeze for Chassis
impl RefUnwindSafe for Chassis
impl Send for Chassis
impl Sync for Chassis
impl Unpin for Chassis
impl UnwindSafe for Chassis
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more