unitforge 0.4.3

A library for unit and quantity consistent computations in Rust
Documentation
#![cfg_attr(
    all(
        feature = "no_std",
        any(feature = "storage-f64", feature = "storage-f32"),
        not(all(feature = "storage-f64", feature = "storage-f32")),
        not(any(
            feature = "serde",
            feature = "ndarray",
            feature = "pyo3",
            feature = "strum"
        ))
    ),
    no_std
)]
#![allow(non_camel_case_types)]

#[cfg(all(
    feature = "no_std",
    any(feature = "storage-f64", feature = "storage-f32"),
    not(all(feature = "storage-f64", feature = "storage-f32")),
    not(any(
        feature = "serde",
        feature = "ndarray",
        feature = "pyo3",
        feature = "strum"
    )),
    not(test),
    not(target_os = "none")
))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
    loop {}
}

#[cfg(all(feature = "storage-f64", feature = "storage-f32"))]
compile_error!("features `storage-f64` and `storage-f32` are mutually exclusive");

#[cfg(all(
    feature = "pyo3",
    any(feature = "storage-f64", feature = "storage-f32")
))]
compile_error!("features `storage-f64` and `storage-f32` cannot be combined with `pyo3`");

#[cfg(all(
    feature = "no_std",
    not(any(feature = "storage-f64", feature = "storage-f32"))
))]
compile_error!("feature `no_std` requires either `storage-f64` or `storage-f32`");

#[cfg(all(
    feature = "no_std",
    any(
        feature = "serde",
        feature = "ndarray",
        feature = "pyo3",
        feature = "strum"
    )
))]
compile_error!("feature `no_std` cannot be combined with `serde`, `ndarray`, `pyo3`, or `strum`");

pub const MAX_ABS_QUANTITY_POWER: i32 = 1024;

pub mod impl_macros;
pub use impl_macros::*;

#[doc(hidden)]
pub mod __private {
    pub use paste;
}

pub mod errors;
pub use errors::*;

mod internal;
pub mod prelude;
mod relations;

unitforge_macros::generate_quantities!();
#[cfg(feature = "pyo3")]
unitforge_macros::generate_vector3_py!();
#[cfg(feature = "pyo3")]
unitforge_macros::generate_matrix3_py!();
#[cfg(feature = "pyo3")]
unitforge_macros::generate_python_module_definition!();

pub use prelude::*;

pub mod quantities {
    pub mod acceleration;
    pub use acceleration::*;
    pub mod angle;
    pub use angle::*;
    pub mod angular_acceleration;
    pub use angular_acceleration::*;
    pub mod angular_velocity;
    pub use angular_velocity::*;
    pub mod area;
    pub use area::*;
    pub mod area_of_moment;
    pub use area_of_moment::*;
    pub mod charge;
    pub use charge::*;
    pub mod compliance;
    pub use compliance::*;
    pub mod density;
    pub use density::*;
    pub mod distance;
    pub use distance::*;
    pub mod force;
    pub use force::*;
    pub mod force_area;
    pub use force_area::*;
    pub mod force_div_distance_power_four;
    pub use force_div_distance_power_four::*;
    pub mod force_per_volume;
    pub use force_per_volume::*;
    pub mod force_volume;
    pub use force_volume::*;
    pub mod frequency;
    pub use frequency::*;
    pub mod inverse_distance;
    pub use inverse_distance::*;
    pub mod inverse_area;
    pub use inverse_area::*;
    pub mod inverse_stress;
    pub use inverse_stress::*;
    pub mod mass;
    pub use mass::*;
    pub mod molar_mass;
    pub use molar_mass::*;
    pub mod mass_per_distance;
    pub use mass_per_distance::*;
    pub mod pressure_rate;
    pub use pressure_rate::*;
    pub mod force_distance;
    pub use force_distance::*;
    pub mod force_stress;
    pub use force_stress::*;
    pub mod specific_gas_constant;
    pub use specific_gas_constant::*;
    pub mod stiffness;
    pub use stiffness::*;
    pub mod rotational_stiffness;
    pub use rotational_stiffness::*;
    pub mod strain;
    pub use strain::*;
    pub mod stress;
    pub use stress::*;
    pub mod stress_squared;
    pub use stress_squared::*;
    pub mod temperature;
    pub use temperature::*;
    pub mod time;
    pub use time::*;
    pub mod universal_gas_constant;
    pub use universal_gas_constant::*;
    pub mod velocity;
    pub use velocity::*;
    pub mod velocity_squared;
    pub use velocity_squared::*;
    pub mod volume;
    pub use volume::*;
    pub mod voltage;
    pub use voltage::*;
    pub mod inverse_angle;
    pub use inverse_angle::*;
}
pub use quantities::*;

pub mod small_linalg {
    pub mod vector3;
    pub use vector3::*;
    pub mod vector2;
    pub use vector2::*;
    pub mod matrix3;
    pub use matrix3::*;
    pub mod matrix2;
    pub use matrix2::*;
    pub mod matrix2x3;
    pub use matrix2x3::*;
    pub mod matrix3x2;
    pub use matrix3x2::*;
}