Crate msuk_scifi

Crate msuk_scifi 

Source
Expand description

Various distance types (Km, Mi, Au, Ly, Pc), temperature (K), mass (EarthMass), etc.

use msuk_scifi::unit::temperature::k::K for e.g. ’K’elvin. use msuk_scifi::unit::distance::au::Au for e.g. ‘Au’ (astronomical unit).

Modules§

test
unit

Macros§

approx_eq
Approx. equivalence with either default or specified epsilon.
approx_eq_upto_n_decimals
As per approx_eq, but with an integer telling up to how many decimals we look for equality.
dbz_panic
define_distance_unit
Define a distance type.
generate_arith_tests_for_distance
implement_arith_generics_for_distance
Implement various arithmetic functionality for the given distance type.
implement_arith_generics_for_temperature
Implement various arithmetic functionality for the given temperature type.
implement_as_for_temperature
Implement as_FOOBAR, as_rounded_FOOBAR, and try_as_FOOBAR for (e.g.) a temperature type.
implement_from_for_distance
Implement a From<X> for the given $type.
implement_from_for_temperature
Implement a number of From<X> for the given type.
implement_unit_conversion
Unit converter core.