Struct fastsim_core::vehicle_utils::VehicleDataEPA
source · pub struct VehicleDataEPA {Show 17 fields
pub year: u32,
pub make: String,
pub model: String,
pub test_id: String,
pub displ: f64,
pub eng_pwr_hp: u32,
pub cylinders: String,
pub transmission_code: String,
pub transmission_type: String,
pub gears: u32,
pub drive_code: String,
pub drive: String,
pub test_weight_lbs: f64,
pub test_fuel_type: String,
pub a_lbf: f64,
pub b_lbf_per_mph: f64,
pub c_lbf_per_mph2: f64,
}Expand description
Struct containing vehicle data from EPA database
Fields§
§year: u32Model year
make: StringVehicle make
model: StringVehicle model
test_id: StringVehicle test group
displ: f64Engine displacement
eng_pwr_hp: u32Engine power in hp
cylinders: StringNumber of cylinders
transmission_code: StringTransmission type code
transmission_type: StringTransmission type
gears: u32Number of gears
drive_code: StringDrive system code
drive: StringDrive system type
test_weight_lbs: f64Test weight in lbs
test_fuel_type: StringFuel type used for EPA test
a_lbf: f64Dyno coefficient a in lbf
b_lbf_per_mph: f64Dyno coefficient b in lbf/mph
c_lbf_per_mph2: f64Dyno coefficient c in lbf/mph^2
Trait Implementations§
source§impl Clone for VehicleDataEPA
impl Clone for VehicleDataEPA
source§fn clone(&self) -> VehicleDataEPA
fn clone(&self) -> VehicleDataEPA
Returns a copy 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 VehicleDataEPA
impl Debug for VehicleDataEPA
source§impl Default for VehicleDataEPA
impl Default for VehicleDataEPA
source§fn default() -> VehicleDataEPA
fn default() -> VehicleDataEPA
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for VehicleDataEPA
impl<'de> Deserialize<'de> for VehicleDataEPA
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 PartialEq for VehicleDataEPA
impl PartialEq for VehicleDataEPA
source§fn eq(&self, other: &VehicleDataEPA) -> bool
fn eq(&self, other: &VehicleDataEPA) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl SerdeAPI for VehicleDataEPA
impl SerdeAPI for VehicleDataEPA
const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _
const ACCEPTED_STR_FORMATS: &'static [&'static str] = _
const CACHE_FOLDER: &'static str = _
source§fn from_resource<P: AsRef<Path>>(filepath: P) -> Result<Self>
fn from_resource<P: AsRef<Path>>(filepath: P) -> Result<Self>
Read (deserialize) an object from a resource file packaged with the
fastsim-core crate Read moresource§fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
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 morefn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>
source§fn from_file<P: AsRef<Path>>(filepath: P) -> Result<Self>
fn from_file<P: AsRef<Path>>(filepath: P) -> Result<Self>
Read (deserialize) an object from a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS. 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) -> Result<Self>
fn from_str<S: AsRef<str>>(contents: S, format: &str) -> Result<Self>
Read (deserialize) an object from a string Read more
source§fn from_reader<R: Read>(rdr: R, format: &str) -> Result<Self>
fn from_reader<R: Read>(rdr: R, format: &str) -> Result<Self>
Deserialize an object from anything that implements
std::io::Read Read moresource§fn from_json<S: AsRef<str>>(json_str: S) -> Result<Self>
fn from_json<S: AsRef<str>>(json_str: S) -> Result<Self>
Read (deserialize) an object to a JSON string Read more
source§fn from_yaml<S: AsRef<str>>(yaml_str: S) -> Result<Self>
fn from_yaml<S: AsRef<str>>(yaml_str: S) -> Result<Self>
Read (deserialize) an object from a YAML string Read more
source§fn from_bincode(encoded: &[u8]) -> Result<Self>
fn from_bincode(encoded: &[u8]) -> Result<Self>
Read (deserialize) an object from bincode-encoded bytes Read more
source§fn from_url<S: AsRef<str>>(url: S) -> Result<Self>
fn from_url<S: AsRef<str>>(url: S) -> Result<Self>
Instantiates an object from a url. Accepts yaml and json file types Read more
source§fn to_cache<P: AsRef<Path>>(&self, file_path: P) -> Result<()>
fn to_cache<P: AsRef<Path>>(&self, file_path: P) -> Result<()>
Takes an instantiated Rust object and saves it in the FASTSim data directory in
a rust_objects folder.
WARNING: If there is a file already in the data subdirectory with the same name, it will be replaced by the new file. Read more
WARNING: If there is a file already in the data subdirectory with the same name, it will be replaced by the new file. Read more
source§fn from_cache<P: AsRef<Path>>(file_path: P) -> Result<Self>
fn from_cache<P: AsRef<Path>>(file_path: P) -> Result<Self>
Instantiates a Rust object from the subdirectory within the FASTSim data
directory corresponding to the Rust Object (“vehices” for a RustVehice,
“cycles” for a RustCycle, and the root folder of the data directory for
all other objects). Read more
source§impl Serialize for VehicleDataEPA
impl Serialize for VehicleDataEPA
impl StructuralPartialEq for VehicleDataEPA
Auto Trait Implementations§
impl RefUnwindSafe for VehicleDataEPA
impl Send for VehicleDataEPA
impl Sync for VehicleDataEPA
impl Unpin for VehicleDataEPA
impl UnwindSafe for VehicleDataEPA
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