pub struct RustVehicle {
Show 126 fields pub doc: Option<String>, pub props: RustPhysicalProperties, pub scenario_name: String, pub selection: u32, pub veh_year: u32, pub veh_pt_type: String, pub drag_coef: f64, pub drag_coef_doc: Option<String>, pub frontal_area_m2: f64, pub frontal_area_m2_doc: Option<String>, pub glider_kg: f64, pub glider_kg_doc: Option<String>, pub veh_cg_m: f64, pub veh_cg_m_doc: Option<String>, pub drive_axle_weight_frac: f64, pub drive_axle_weight_frac_doc: Option<String>, pub wheel_base_m: f64, pub wheel_base_m_doc: Option<String>, pub cargo_kg: f64, pub cargo_kg_doc: Option<String>, pub veh_override_kg: Option<f64>, pub veh_override_kg_doc: Option<String>, pub comp_mass_multiplier: f64, pub comp_mass_multiplier_doc: Option<String>, pub fs_max_kw: f64, pub fs_max_kw_doc: Option<String>, pub fs_secs_to_peak_pwr: f64, pub fs_secs_to_peak_pwr_doc: Option<String>, pub fs_kwh: f64, pub fs_kwh_doc: Option<String>, pub fs_kwh_per_kg: f64, pub fs_kwh_per_kg_doc: Option<String>, pub fc_max_kw: f64, pub fc_max_kw_doc: Option<String>, pub fc_pwr_out_perc: Array1<f64>, pub fc_pwr_out_perc_doc: Option<String>, pub fc_eff_map: Array1<f64>, pub fc_eff_map_doc: Option<String>, pub fc_eff_type: String, pub fc_eff_type_doc: Option<String>, pub fc_sec_to_peak_pwr: f64, pub fc_sec_to_peak_pwr_doc: Option<String>, pub fc_base_kg: f64, pub fc_base_kg_doc: Option<String>, pub fc_kw_per_kg: f64, pub fc_kw_per_kg_doc: Option<String>, pub min_fc_time_on: f64, pub min_fc_time_on_doc: Option<String>, pub idle_fc_kw: f64, pub idle_fc_kw_doc: Option<String>, pub mc_max_kw: f64, pub mc_max_kw_doc: Option<String>, pub mc_pwr_out_perc: Array1<f64>, pub mc_pwr_out_perc_doc: Option<String>, pub mc_eff_map: Array1<f64>, pub mc_eff_map_doc: Option<String>, pub mc_sec_to_peak_pwr: f64, pub mc_sec_to_peak_pwr_doc: Option<String>, pub mc_pe_kg_per_kw: f64, pub mc_pe_kg_per_kw_doc: Option<String>, pub mc_pe_base_kg: f64, pub mc_pe_base_kg_doc: Option<String>, pub ess_max_kw: f64, pub ess_max_kw_doc: Option<String>, pub ess_max_kwh: f64, pub ess_max_kwh_doc: Option<String>, pub ess_kg_per_kwh: f64, pub ess_kg_per_kwh_doc: Option<String>, pub ess_base_kg: f64, pub ess_base_kg_doc: Option<String>, pub ess_round_trip_eff: f64, pub ess_round_trip_eff_doc: Option<String>, pub ess_life_coef_a: f64, pub ess_life_coef_a_doc: Option<String>, pub ess_life_coef_b: f64, pub ess_life_coef_b_doc: Option<String>, pub min_soc: f64, pub min_soc_doc: Option<String>, pub max_soc: f64, pub max_soc_doc: Option<String>, pub ess_dischg_to_fc_max_eff_perc: f64, pub ess_dischg_to_fc_max_eff_perc_doc: Option<String>, pub ess_chg_to_fc_max_eff_perc: f64, pub ess_chg_to_fc_max_eff_perc_doc: Option<String>, pub wheel_inertia_kg_m2: f64, pub wheel_inertia_kg_m2_doc: Option<String>, pub num_wheels: f64, pub num_wheels_doc: Option<String>, pub wheel_rr_coef: f64, pub wheel_rr_coef_doc: Option<String>, pub wheel_radius_m: f64, pub wheel_radius_m_doc: Option<String>, pub wheel_coef_of_fric: f64, pub wheel_coef_of_fric_doc: Option<String>, pub max_accel_buffer_mph: f64, pub max_accel_buffer_mph_doc: Option<String>, pub max_accel_buffer_perc_of_useable_soc: f64, pub max_accel_buffer_perc_of_useable_soc_doc: Option<String>, pub perc_high_acc_buf: f64, pub perc_high_acc_buf_doc: Option<String>, pub mph_fc_on: f64, pub mph_fc_on_doc: Option<String>, pub kw_demand_fc_on: f64, pub kw_demand_fc_on_doc: Option<String>, pub max_regen: f64, pub max_regen_doc: Option<String>, pub stop_start: bool, pub stop_start_doc: Option<String>, pub force_aux_on_fc: bool, pub force_aux_on_fc_doc: Option<String>, pub alt_eff: f64, pub alt_eff_doc: Option<String>, pub chg_eff: f64, pub chg_eff_doc: Option<String>, pub aux_kw: f64, pub aux_kw_doc: Option<String>, pub trans_kg: f64, pub trans_kg_doc: Option<String>, pub trans_eff: f64, pub trans_eff_doc: Option<String>, pub ess_to_fuel_ok_error: f64, pub ess_to_fuel_ok_error_doc: Option<String>, pub fc_peak_eff_override: Option<f64>, pub fc_peak_eff_override_doc: Option<String>, pub mc_peak_eff_override: Option<f64>, pub mc_peak_eff_override_doc: Option<String>, /* private fields */
}
Expand description

Struct containing vehicle attributes

§Python Examples

import fastsim

## Load drive cycle by name
cyc_py = fastsim.cycle.Cycle.from_file("udds")
cyc_rust = cyc_py.to_rust()

Fields§

§doc: Option<String>

Vehicle level documentation – e.g. info about calibration/validation of vehicle and/or links to reports or other long-form documentation.

§props: RustPhysicalProperties

Physical properties, see RustPhysicalProperties

§scenario_name: String

Vehicle name

§selection: u32

Vehicle database ID

§veh_year: u32

Vehicle year

§veh_pt_type: String

Vehicle powertrain type, one of [CONV, HEV, PHEV, BEV]

§drag_coef: f64

Aerodynamic drag coefficient

§drag_coef_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§frontal_area_m2: f64

Frontal area, $m^2$

§frontal_area_m2_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§glider_kg: f64

Vehicle mass excluding cargo, passengers, and powertrain components, $kg$

§glider_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§veh_cg_m: f64

Vehicle center of mass height, $m$ NOTE: positive for FWD, negative for RWD, AWD, 4WD

§veh_cg_m_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§drive_axle_weight_frac: f64

Fraction of weight on the drive axle while stopped

§drive_axle_weight_frac_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§wheel_base_m: f64

Wheelbase, $m$

§wheel_base_m_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§cargo_kg: f64

Cargo mass including passengers, $kg$

§cargo_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§veh_override_kg: Option<f64>

Total vehicle mass, overrides mass calculation, $kg$

§veh_override_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§comp_mass_multiplier: f64

Component mass multiplier for vehicle mass calculation

§comp_mass_multiplier_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fs_max_kw: f64

Fuel storage max power output, $kW$

§fs_max_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fs_secs_to_peak_pwr: f64

Fuel storage time to peak power, $s$

§fs_secs_to_peak_pwr_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fs_kwh: f64

Fuel storage energy capacity, $kWh$

§fs_kwh_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fs_kwh_per_kg: f64

Fuel specific energy, $\frac{kWh}{kg}$

§fs_kwh_per_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_max_kw: f64

Fuel converter peak continuous power, $kW$

§fc_max_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_pwr_out_perc: Array1<f64>

Fuel converter output power percentage map, x values of fc_eff_map

§fc_pwr_out_perc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_eff_map: Array1<f64>

Fuel converter efficiency map

§fc_eff_map_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_eff_type: String

Fuel converter efficiency type, one of [SI, ATKINSON, DIESEL, H2FC, HD_DIESEL] Used for calculating fc_eff_map, and other calculations if H2FC

§fc_eff_type_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_sec_to_peak_pwr: f64

Fuel converter time to peak power, $s$

§fc_sec_to_peak_pwr_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_base_kg: f64

Fuel converter base mass, $kg$

§fc_base_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_kw_per_kg: f64

Fuel converter specific power (power-to-weight ratio), $\frac{kW}{kg}$

§fc_kw_per_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§min_fc_time_on: f64

Minimum time fuel converter must be on before shutoff (for HEV, PHEV)

§min_fc_time_on_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§idle_fc_kw: f64

Fuel converter idle power, $kW$

§idle_fc_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_max_kw: f64

Peak continuous electric motor power, $kW$

§mc_max_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_pwr_out_perc: Array1<f64>

Electric motor output power percentage map, x values of mc_eff_map

§mc_pwr_out_perc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_eff_map: Array1<f64>

Electric motor efficiency map

§mc_eff_map_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_sec_to_peak_pwr: f64

Electric motor time to peak power, $s$

§mc_sec_to_peak_pwr_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_pe_kg_per_kw: f64

Motor power electronics mass per power output, $\frac{kg}{kW}$

§mc_pe_kg_per_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_pe_base_kg: f64

Motor power electronics base mass, $kg$

§mc_pe_base_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_max_kw: f64

Traction battery maximum power output, $kW$

§ess_max_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_max_kwh: f64

Traction battery energy capacity, $kWh$

§ess_max_kwh_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_kg_per_kwh: f64

Traction battery mass per energy, $\frac{kg}{kWh}$

§ess_kg_per_kwh_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_base_kg: f64

Traction battery base mass, $kg$

§ess_base_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_round_trip_eff: f64

Traction battery round-trip efficiency

§ess_round_trip_eff_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_life_coef_a: f64

Traction battery cycle life coefficient A, see reference

§ess_life_coef_a_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_life_coef_b: f64

Traction battery cycle life coefficient B, see reference

§ess_life_coef_b_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§min_soc: f64

Traction battery minimum state of charge

§min_soc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§max_soc: f64

Traction battery maximum state of charge

§max_soc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_dischg_to_fc_max_eff_perc: f64

ESS discharge effort toward max FC efficiency

§ess_dischg_to_fc_max_eff_perc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_chg_to_fc_max_eff_perc: f64

ESS charge effort toward max FC efficiency

§ess_chg_to_fc_max_eff_perc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§wheel_inertia_kg_m2: f64

Mass moment of inertia per wheel, $kg \cdot m^2$

§wheel_inertia_kg_m2_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§num_wheels: f64

Number of wheels

§num_wheels_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§wheel_rr_coef: f64

Rolling resistance coefficient

§wheel_rr_coef_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§wheel_radius_m: f64

Wheel radius, $m$

§wheel_radius_m_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§wheel_coef_of_fric: f64

Wheel coefficient of friction

§wheel_coef_of_fric_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§max_accel_buffer_mph: f64

Speed where the battery reserved for accelerating is zero

§max_accel_buffer_mph_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§max_accel_buffer_perc_of_useable_soc: f64

Percent of usable battery energy reserved to help accelerate

§max_accel_buffer_perc_of_useable_soc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§perc_high_acc_buf: f64

Percent SOC buffer for high accessory loads during cycles with long idle time

§perc_high_acc_buf_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mph_fc_on: f64

Speed at which the fuel converter must turn on, $mph$

§mph_fc_on_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§kw_demand_fc_on: f64

Power demand above which to require fuel converter on, $kW$

§kw_demand_fc_on_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§max_regen: f64

Maximum brake regeneration efficiency

§max_regen_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§stop_start: bool

Stop/start micro-HEV flag

§stop_start_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§force_aux_on_fc: bool

Force auxiliary power load to come from fuel converter

§force_aux_on_fc_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§alt_eff: f64

Alternator efficiency

§alt_eff_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§chg_eff: f64

Charger efficiency

§chg_eff_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§aux_kw: f64

Auxiliary load power, $kW$

§aux_kw_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§trans_kg: f64

Transmission mass, $kg$

§trans_kg_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§trans_eff: f64

Transmission efficiency

§trans_eff_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§ess_to_fuel_ok_error: f64

Maximum acceptable ratio of change in ESS energy to expended fuel energy (used in hybrid SOC balancing), $\frac{\Delta E_{ESS}}{\Delta E_{fuel}}$

§ess_to_fuel_ok_error_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§fc_peak_eff_override: Option<f64>

Fuel converter efficiency peak override, scales entire curve

§fc_peak_eff_override_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

§mc_peak_eff_override: Option<f64>

Motor efficiency peak override, scales entire curve

§mc_peak_eff_override_doc: Option<String>

String for documentation – e.g. info about calibration/validation.

Implementations§

source§

impl RustVehicle

RustVehicle rust methods

source

pub fn set_veh_mass(&mut self)

Sets the following parameters:

  • ess_mass_kg
  • mc_mass_kg
  • fc_mass_kg
  • fs_mass_kg
  • veh_kg
  • max_trac_mps2
source

pub fn mc_peak_eff(&self) -> f64

source

pub fn max_fc_eff_kw(&self) -> f64

Returns first FC output power at which peak efficiency occurs

source

pub fn fc_peak_eff(&self) -> f64

source

pub fn set_mc_peak_eff(&mut self, new_peak: f64)

source

pub fn set_fc_peak_eff(&mut self, new_peak: f64)

source

pub fn set_derived(&mut self) -> Result<()>

Sets derived parameters:

  • no_elec_sys
  • no_elec_aux
  • fc_perc_out_array
  • input_kw_out_array
  • fc_kw_out_array
  • fc_eff_array
  • modern_diff
  • large_baseline_eff_adj
  • mc_kw_adj_perc
  • mc_eff_map
  • mc_eff_array
  • mc_perc_out_array
  • mc_kw_out_array
  • mc_full_eff_array
  • mc_kw_in_array
  • mc_max_elec_in_kw
  • set_fc_peak_eff()
  • set_mc_peak_eff()
  • set_veh_mass()
    • ess_mass_kg
    • mc_mass_kg
    • fc_mass_kg
    • fs_mass_kg
    • veh_kg
    • max_trac_mps2
source

pub fn mock_vehicle() -> Self

source

pub fn from_github_or_url<S: AsRef<str>>( vehicle_file_name: S, url: Option<S> ) -> Result<Self>

Downloads specified vehicle from FASTSim vehicle repo or url and instantiates it into a RustVehicle. Notes in vehicle.doc the origin of the vehicle. Returns vehicle.

§Arguments
  • vehicle_file_name: file name for vehicle to be downloaded, including path from url directory or FASTSim repository (if applicable)
  • url: url for vehicle repository where vehicle will be downloaded from, if None, assumed to be downloaded from vehicle FASTSim repo
    Note: The URL needs to be a URL pointing directly to a file, for example a raw github URL, split up so that the “url” argument is the path to the directory, and the “vehicle_file_name” is the path within the directory to the file.
    Note: If downloading from the FASTSim Vehicle Repo, the vehicle_file_name should include the path to the file from the root of the Repo, as listed in the output of the vehicle_utils::fetch_github_list() function.
    Note: the url should not include the file name, only the path to the file or a root directory of the file.

Trait Implementations§

source§

impl ApproxEq for RustVehicle

source§

fn approx_eq(&self, other: &RustVehicle, tol: f64) -> bool

source§

impl Clone for RustVehicle

source§

fn clone(&self) -> RustVehicle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RustVehicle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RustVehicle

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for RustVehicle

source§

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 RustVehicle

source§

fn eq(&self, other: &RustVehicle) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SerdeAPI for RustVehicle

source§

fn from_url<S: AsRef<str>>(url: S) -> Result<Self>

instantiates a vehicle from a url, and notes in vehicle.doc the origin of the vehicle.
accepts yaml and json file types

§Arguments
  • url: URL (either as a string or url type) to object
    Note: The URL needs to be a URL pointing directly to a file, for example a raw github URL.
source§

const CACHE_FOLDER: &'static str = _

source§

fn init(&mut self) -> Result<()>

Specialized code to execute upon initialization
source§

const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _

source§

const ACCEPTED_STR_FORMATS: &'static [&'static str] = _

source§

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 more
source§

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 more
source§

fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>

source§

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 more
source§

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>

Read (deserialize) an object from a string Read more
source§

fn from_reader<R: Read>(rdr: R, format: &str) -> Result<Self>

Deserialize an object from anything that implements std::io::Read Read more
source§

fn to_json(&self) -> Result<String>

Write (serialize) an object to a JSON string
source§

fn from_json<S: AsRef<str>>(json_str: S) -> Result<Self>

Read (deserialize) an object to a JSON string Read more
source§

fn to_yaml(&self) -> Result<String>

Write (serialize) an object to a YAML string
source§

fn from_yaml<S: AsRef<str>>(yaml_str: S) -> Result<Self>

Read (deserialize) an object from a YAML string Read more
source§

fn to_bincode(&self) -> Result<Vec<u8>>

Write (serialize) an object to bincode-encoded bytes
source§

fn from_bincode(encoded: &[u8]) -> Result<Self>

Read (deserialize) an object from bincode-encoded bytes Read more
source§

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
source§

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 RustVehicle

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Validate for RustVehicle

source§

impl<'v_a> ValidateArgs<'v_a> for RustVehicle

§

type Args = ()

source§

fn validate_args(&self, args: Self::Args) -> Result<(), ValidationErrors>

source§

impl StructuralPartialEq for RustVehicle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> DeserializeOwnedAlias for T

source§

impl<T> SendAlias for T

§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

source§

impl<T> SerializeAlias for T
where T: Serialize,

source§

impl<T> SyncAlias for T