Skip to main content

Module prelude

Module prelude 

Source
Expand description

This module reexports all wire types defined in stem_wire, the Wire trait as well as the stem_material::prelude module to simplify the usage of this crate.

Re-exports§

pub use crate::cast::CastWire;
pub use crate::rectangular::RectangularWire;
pub use crate::round::RoundWire;
pub use crate::sff::SffWire;
pub use crate::stranded::StrandedWire;
pub use crate::stranded::WireGroup;
pub use crate::wire::Wire;
pub use stem_material;

Modules§

dyn_quantity
dyn_quantity
jordan_model
An implementation of the Jordan model for iron losses in the core lamination.
typetag
githubcrates-iodocs-rs
unary
This module contains unary functions which implement IsQuantityFunction.

Structs§

ClampedQuantity
A wrapper around a type implementing IsQuantityFunction trait object which clamps the output of IsQuantityFunction::call using the provided upper and lower limits.
DynQuantity
This type represents a physical quantity via its numerical value and a unit of measurement (field exponents). The unit of measurement is not defined via the type system, but rather via the values of the Unit. This means that the unit of measurement is not fixed at compile time, but can change dynamically at runtime.
FailedCoefficientCalculation
A struct representing a failed JordanModel coefficient calculation attempt.
FerromagneticPermeability
A ferromagnetic permeability characteristic optimized for calculations.
FitLossCurve
This struct is a “flattened” version of IronLossData. It is not meant to be used on its own and is just exposed so the optimization result of IronLossData::solve_for_coefficients can be examined. See its docstring for more.
FluxDensityLossPair
A single datapoint of an IronLossCharacteristic.
IronLossCharacteristic
A iron loss characteristic for a specific frequency.
IronLossData
A container for multiple IronLossCharacteristics.
JordanModel
Implementation of the Jordan iron loss model.
MagnetizationCurve
A collection of datapoints representing the magnetization curve of a material.
Material
A substance which constitutes an object, e.g. a magnet or a wire in stem.
NotConvertibleFromComplexF64
Error describing a failed attempt to convert a Complex<f64> into the type V of DynQuantity<V>.
ParseError
Error representing a failed attempt to parse a string into a DynQuantity.
PolarizationCurve
A collection of datapoints representing the polarization curve of a material.
QuantityFunction
A thin wrapper around a Box<dyn IsQuantityFunction> trait object which provides some type checks for usage in VarQuantity.
RootError
Error representing a failed attempt to calculate the nth root of an Unit.
Unit
Struct representing a unit of measurement in the SI system via the exponents of the base units. The unit is purely defined by the values of its fields, meaning that it can change at runtime. The struct implements basic arithmetic functions such as multiplication and division (via the Mul, MulAssign, Div, DivAssign traits), exponentiation (Unit::powi) and a fallible version of root calculation (Unit::try_nthroot).
UnitsNotEqual
Error representing unequality of units.
VACUUM_PERMEABILITY
SI-value of the vacuum magnetic permeability (4π1e-7 NA²) with units. See VACUUM_PERMEABILITY_UNITLESS for more.
ampere
The ampere is the SI unit of electric current. It is defined by taking the fixed numerical value of the elementary charge e to be 1.602 176 634 × 10⁻¹⁹ when expressed in the unit C, which is equal to A s, where the second is defined in terms of ∆νCs.
ampere_per_centimeter
amperes per centimeter
ampere_per_meter
amperes per meter
ampere_per_micrometer
amperes per micrometer
centimeter
centimeters
centimeter_per_second
centimeters per second
centimeter_per_second_squared
centimeters per second squared
cubic_centimeter
cubic centimeters
cubic_centimeter_per_gram
cubic centimeters per gram
cubic_kilometer
cubic kilometers
cubic_meter
cubic meters
cubic_meter_per_gram
cubic meters per gram
cubic_meter_per_kilogram
cubic meters per kilogram
cubic_micrometer
cubic micrometers
cubic_millimeter
cubic millimeters
day
days
degree_celsius
degrees Celsius
gigaampere
gigaamperes
gigahertz
gigahertz
gigajoule
gigajoules
giganewton
giganewtons
gigaohm
gigaohms
gigaohm_meter
gigaohm meters
gigasiemens
gigasiemens
gigatesla
gigateslas
gigavolt
gigavolts
gigawatt
gigawatts
gigawatt_per_kelvin
gigawatts per kelvin
gigawatt_per_kilogram
gigawatts per kilogram
gigawatt_per_meter_kelvin
gigawatts per meter kelvin
gigaweber
gigawebers
gram
grams
gram_per_cubic_meter
grams per cubic meter
henry_per_meter
henrys per meter
hertz
The hertz is one cycle per second.
hour
hours
joule
Derived unit of energy.
joule_per_degree_celsius
joules per degree celsius
joule_per_kelvin
Derived unit of heat capacity expressed in terms of derived unit Joule. Equivalent to kg · m²/(s² · K).
joule_per_kilogram_kelvin
Derived unit of specific heat capacity expressed in derived units. Equivalent to m²/(s² · K).
kelvin
The kelvin is the SI unit of thermodynamic temperature. It is defined by taking the fixed numerical value of the Boltzmann constant k to be 1.380 649 × 10⁻²³ when expressed in the unit J K⁻¹, which is equal to kg m² s⁻² K⁻¹, where the kilogram, meter, and second are defined in terms of h, c, and ∆νCs.
kiloampere
kiloamperes
kilogram
The kilogram is the SI unit of mass. It is defined by taking the fixed numerical value of the Planck constant h to be 6.626 070 15 × 10⁻³⁴ when expressed in the unit J s, which is equal to kg m² s⁻¹, where the meter and the second are defined in terms of c and ∆νCs.
kilogram_per_cubic_meter
Derived unit of density.
kilogram_square_meter
kilogram square meters
kilohertz
kilohertz
kilojoule
kilojoules
kilojoule_per_kilogram_kelvin
kilojoules per kilogram kelvin
kilokelvin
kilokelvins
kilometer
kilometers
kilometer_per_hour
kilometers per hour
kilometer_per_second
kilometers per second
kilometer_per_second_squared
kilometers per second squared
kilonewton
kilonewtons
kiloohm
kiloohms
kiloohm_meter
kiloohm meters
kilosiemens
kilosiemens
kilotesla
kiloteslas
kilovolt
kilovolts
kilowatt
kilowatts
kilowatt_per_kelvin
kilowatts per kelvin
kilowatt_per_kilogram
kilowatts per kilogram
kilowatt_per_meter_kelvin
kilowatts per meter kelvin
kiloweber
kilowebers
megaampere
megaamperes
megahertz
megahertz
megajoule
megajoules
meganewton
meganewtons
megaohm
megaohms
megaohm_meter
megaohm meters
megasiemens
megasiemens
megatesla
megateslas
megavolt
megavolts
megawatt
megawatts
megawatt_per_kelvin
megawatts per kelvin
megawatt_per_kilogram
megawatts per kilogram
megawatt_per_meter_kelvin
megawatts per meter kelvin
megaweber
megawebers
meter
The meter is the SI unit of length. It is defined by taking the fixed numerical value of the speed of light in vacuum c to be 299 792 458 when expressed in the unit m s⁻¹, where the second is defined in terms of the caesium frequency ∆νCs.
meter_per_second
meters per second
meter_per_second_squared
meters per second squared
microampere
microamperes
microgram
micrograms
microgram_per_cubic_meter
micrograms per cubic meter
microhertz
microhertz
microjoule
microjoules
microkelvin
microkelvins
micrometer
micrometers
micrometer_per_second
micrometers per second
micronewton
micronewtons
microohm
microohms
microohm_meter
microohm meters
microsecond
microseconds
microsiemens
microsiemens
microtesla
microteslas
microvolt
microvolts
microwatt
microwatts
microwatt_per_kelvin
microwatts per kelvin
microwatt_per_kilogram
microwatts per kilogram
microwatt_per_meter_kelvin
microwatts per meter kelvin
microweber
microwebers
milliampere
millamperes
milligram
milligrams
milligram_per_cubic_meter
milligrams per cubic meter
millihertz
millihertz
millijoule
millijoules
millikelvin
millikelvins
millimeter
millimeters
millimeter_per_minute
millimeters per minute
millimeter_per_minute_squared
millimeters per minute squared
millimeter_per_second
millimeters per second
millimeter_per_second_squared
millimeters per second squared
millinewton
millinewtons
milliohm
milliohms
milliohm_meter
milliohm meters
millisecond
milliseconds
millisiemens
millisiemens
millitesla
milliteslas
millivolt
millivolts
milliwatt
milliwatts
milliwatt_per_kelvin
milliwatts per kelvin
milliwatt_per_kilogram
milliwatts per kilogram
milliwatt_per_meter_kelvin
milliwatts per meter kelvin
milliweber
milliwebers
minute
minutes
newton
Derived unit of force.
newton_centimeter
newton centimeters
newton_kilometer
newton kilometers
newton_meter
Derived unit of torque.
newton_micrometer
newton micrometers
newton_millimeter
newton millimeters
ohm
Derived unit of electrical resistance.
ohm_centimeter
ohm centimeters
ohm_meter
Derived unit of electrical resistance.
ohm_square_millimeter_per_meter
ohm square millimeters per meter
radian_per_second
Derived unit of angular velocity.
radian_per_second_squared
Derived unit of angular acceleration.
ratio
reciprocal_centimeter
reciprocal centimeters
reciprocal_kilometer
reciprocal kilometers
reciprocal_micrometer
reciprocal micrometers
reciprocal_millimeter
reciprocal millimeters
revolution_per_hour
revolutions per hour
revolution_per_minute
revolutions per minute
revolution_per_second
revolutions per second
second
The second is the SI unit of time. It is defined by taking the fixed numerical value of the caesium frequency ∆νCs, the unperturbed ground-state hyperfine transition frequency of the caesium 133 atom, to be 9 192 631 770 when expressed in the unit Hz, which is equal to s⁻¹.
siemens
Derived unit of electrical conductance.
siemens_per_centimeter
siemens per centimeter
siemens_per_meter
siemens per meter
square_centimeter
square centimeters
square_kilometer
square kilometers
square_meter
square meters
square_micrometer
square micrometers
square_millimeter
square millimeters
standard_gravity
standard accelerations of gravity
tesla
Derived unit of magnetic flux density.
ton
Ton Metric
ton_per_cubic_meter
tons per cubic meter
volt
Derived unit of electric potential.
watt
Derived unit of power.
watt_per_kelvin
Derived unit of thermal conductance in derived units. Equivalent to kg · m²/(s³ · K).
watt_per_kilogram
Derived unit of specific power.
watt_per_meter_kelvin
Derived unit of thermal conductivity in derived units. Equivalent to kg · m/(s³ · K).
weber
Derived unit of magnetic flux.
year
years

Enums§

ConversionError
Error describing a failed attempt to convert between different types representing quantities.
InvalidInputData
Errors which can occur when attempting to convert a MagnetizationCurve or PolarizationCurve into a FerromagneticPermeability.
IronLosses
A specialized variant of VarQuantity<SpecificPower> for iron losses.
ParseErrorReason
The varying reasons parsing a string to a DynQuantity can fail. This struct is part of ParseError, which contains the information where the parsing failed.
PredefUnit
An enum representing predefined Units.
RelativePermeability
A specialized variant of VarQuantity<f64> for relative permeability.
VarQuantity
A quantity whose value can either be constant or a function of one or more other quantities.

Constants§

SERIALIZE_WITH_UNITS
A thread-local, static variable which enables / disables serialization of quantities with or without units. It is used within the functions serialize_quantity, serialize_opt_quantity, serialize_angle and serialize_opt_angle as a thread-local context to decide whether a quantity should be serialized with or without its units. By default, its value is false, meaning that quantities are serialized without their units. The serialize_with_units function sets it temporarily to true, then performs the actual serialization, and afterwards resets it to false again (return to default behaviour).
VACUUM_PERMEABILITY_UNITLESS
SI-value of the vacuum magnetic permeability (4π1e-7 NA²) without units.

Traits§

FieldStrengthOrFluxDensity
Sealed helper trait for FerromagneticPermeability::get.
IsQuantity
This is a marker trait which defines trait bounds for all types T which can be used as “quantities” in VarQuantity<T>. It does not provide any methods and is auto-implemented for all T fulfilling the bounds, hence it is not necessary to ever import this trait. It is only public to make compiler error messages more helpful.
IsQuantityFunction
Trait used to construct variable quantities whose value is a (pure) function of other quantities.
UnitFromType
A trait to derive Unit from a type. This trait bridges the gap between (external) types representing physical quantities (such as e.g. the Quantity type from the uom crate) and Unit.

Functions§

deserialize_angle
Deserializes an angle from a valid DynQuantity representation (see docstring of DynQuantity). The output value is always in radians.
deserialize_opt_angle
Like deserialize_angle, but deserializes into an Option<f64> instead of a f64.
deserialize_opt_quantity
Like deserialize_quantity, but deserializes into an Option<T> instead of a T implementing TryFrom<DynQuantity>.
deserialize_opt_vec_of_quantities
Like deserialize_vec_of_quantities, but deserializes into an Option<Vec<T>> instead of a Vec<T>.
deserialize_quantity
Deserializes a type T implementing TryFrom<DynQuantity> from a valid DynQuantity representation (see docstring of DynQuantity).
deserialize_vec_of_quantities
Deserializes a vector of T which implements TryFrom<DynQuantity> from:
filter_unary_function
A helper function which filters the conditions for a quantity with the type match_for. If a matching quantity is found, it is used as argument for F and the result is returned. Otherwise, the result of G() is returned.
serialize_angle
Enables serialization of an angle into a string containing both the value and the “rad” unit.
serialize_opt_angle
Like serialize_angle, but serializes an [&Option<T>] instead of a &T implementing Into<DynQuantity>.
serialize_opt_quantity
Like serialize_quantity, but serializes an [&Option<T>] instead of a &T implementing Into<DynQuantity>.
serialize_quantity
Enables serialization of a quantity (any type implementing Into<DynQuantity>) into a string containing both the value and the units.
serialize_with_units
A wrapper around a serialization function / closure which enables serialization with units.

Type Aliases§

Absement
Quantity type alias using the default base units.
Acceleration
Quantity type alias using the default base units.
Action
Quantity type alias using the default base units.
AmountOfSubstance
Quantity type alias using the default base units.
Angle
Quantity type alias using the default base units.
AngularAbsement
Quantity type alias using the default base units.
AngularAcceleration
Quantity type alias using the default base units.
AngularJerk
Quantity type alias using the default base units.
AngularVelocity
Quantity type alias using the default base units.
Area
Quantity type alias using the default base units.
ArealDensityOfStates
Quantity type alias using the default base units.
ArealHeatCapacity
Quantity type alias using the default base units.
ArealMassDensity
Quantity type alias using the default base units.
ArealNumberDensity
Quantity type alias using the default base units.
ArealNumberRate
Quantity type alias using the default base units.
AvailableEnergy
Quantity type alias using the default base units.
Capacitance
Quantity type alias using the default base units.
CatalyticActivity
Quantity type alias using the default base units.
CatalyticActivityConcentration
Quantity type alias using the default base units.
Curvature
Quantity type alias using the default base units.
DiffusionCoefficient
Quantity type alias using the default base units.
DynamicViscosity
Quantity type alias using the default base units.
ElectricCharge
Quantity type alias using the default base units.
ElectricChargeArealDensity
Quantity type alias using the default base units.
ElectricChargeLinearDensity
Quantity type alias using the default base units.
ElectricChargeVolumetricDensity
Quantity type alias using the default base units.
ElectricCurrent
Quantity type alias using the default base units.
ElectricCurrentDensity
Quantity type alias using the default base units.
ElectricDipoleMoment
Quantity type alias using the default base units.
ElectricDisplacementField
Quantity type alias using the default base units.
ElectricField
Quantity type alias using the default base units.
ElectricFlux
Quantity type alias using the default base units.
ElectricPermittivity
Quantity type alias using the default base units.
ElectricPotential
Quantity type alias using the default base units.
ElectricQuadrupoleMoment
Quantity type alias using the default base units.
ElectricalConductance
Quantity type alias using the default base units.
ElectricalConductivity
Quantity type alias using the default base units.
ElectricalMobility
Quantity type alias using the default base units.
ElectricalResistance
Quantity type alias using the default base units.
ElectricalResistivity
Quantity type alias using the default base units.
Energy
Quantity type alias using the default base units.
Force
Quantity type alias using the default base units.
Frequency
Quantity type alias using the default base units.
FrequencyDrift
Quantity type alias using the default base units.
HeatCapacity
Quantity type alias using the default base units.
HeatFluxDensity
Quantity type alias using the default base units.
HeatTransfer
Quantity type alias using the default base units.
Inductance
Quantity type alias using the default base units.
Information
Quantity type alias using the default base units.
InformationRate
Quantity type alias using the default base units.
InverseVelocity
Quantity type alias using the default base units.
Jerk
Quantity type alias using the default base units.
Length
Quantity type alias using the default base units.
LinearDensityOfStates
Quantity type alias using the default base units.
LinearMassDensity
Quantity type alias using the default base units.
LinearNumberDensity
Quantity type alias using the default base units.
LinearNumberRate
Quantity type alias using the default base units.
LinearPowerDensity
Quantity type alias using the default base units.
Luminance
Quantity type alias using the default base units.
LuminousIntensity
Quantity type alias using the default base units.
MagneticFieldStrength
Quantity type alias using the default base units.
MagneticFlux
Quantity type alias using the default base units.
MagneticFluxDensity
Quantity type alias using the default base units.
MagneticMoment
Quantity type alias using the default base units.
MagneticPermeability
Quantity type alias using the default base units.
Mass
Quantity type alias using the default base units.
MassConcentration
Quantity type alias using the default base units.
MassDensity
Quantity type alias using the default base units.
MassFlux
Quantity type alias using the default base units.
MassPerEnergy
Quantity type alias using the default base units.
MassRate
Quantity type alias using the default base units.
Molality
Quantity type alias using the default base units.
MolarConcentration
Quantity type alias using the default base units.
MolarEnergy
Quantity type alias using the default base units.
MolarFlux
Quantity type alias using the default base units.
MolarHeatCapacity
Quantity type alias using the default base units.
MolarMass
Quantity type alias using the default base units.
MolarRadioactivity
Quantity type alias using the default base units.
MolarVolume
Quantity type alias using the default base units.
MomentOfInertia
Quantity type alias using the default base units.
Momentum
Quantity type alias using the default base units.
Power
Quantity type alias using the default base units.
PowerRate
Quantity type alias using the default base units.
Pressure
Quantity type alias using the default base units.
RadiantExposure
Quantity type alias using the default base units.
Radioactivity
Quantity type alias using the default base units.
Ratio
Quantity type alias using the default base units.
ReciprocalLength
Quantity type alias using the default base units.
SolidAngle
Quantity type alias using the default base units.
SpecificArea
Quantity type alias using the default base units.
SpecificHeatCapacity
Quantity type alias using the default base units.
SpecificPower
Quantity type alias using the default base units.
SpecificRadioactivity
Quantity type alias using the default base units.
SpecificVolume
Quantity type alias using the default base units.
SurfaceElectricCurrentDensity
Quantity type alias using the default base units.
TemperatureCoefficient
Quantity type alias using the default base units.
TemperatureGradient
Quantity type alias using the default base units.
TemperatureInterval
Quantity type alias using the default base units.
ThermalConductance
Quantity type alias using the default base units.
ThermalConductivity
Quantity type alias using the default base units.
ThermalResistance
Quantity type alias using the default base units.
ThermodynamicTemperature
Quantity type alias using the default base units.
Time
Quantity type alias using the default base units.
Torque
Quantity type alias using the default base units.
V
Storage type.
Velocity
Quantity type alias using the default base units.
Volume
Quantity type alias using the default base units.
VolumeRate
Quantity type alias using the default base units.
VolumetricDensityOfStates
Quantity type alias using the default base units.
VolumetricHeatCapacity
Quantity type alias using the default base units.
VolumetricNumberDensity
Quantity type alias using the default base units.
VolumetricNumberRate
Quantity type alias using the default base units.
VolumetricPowerDensity
Quantity type alias using the default base units.