liberty-db 0.1.5

`liberty` data structre
Documentation
// mod uom{
//! Partially re-exported [uom](https://crates.io/crates/uom) quantities and measurement units
//! used in the library public interface.


// pub fn fuzzy_cmp<T: std::ops::Add<T, T> + std::ops::Sub<T, T> + PartialOrd>(a: T, b: T, tolerance: T) -> bool {
//     a >= b - tolerance && a <= b + tolerance
// }

// use std::ops::Add;

#[cfg(not(feature = "f32"))]
pub use uom::si::f64::{
    Capacitance,
    ElectricalResistance,
    Length,
    ElectricCharge, 
    ElectricCurrent, 
    ElectricPotential, 
    Energy, 
    Power, 
    Ratio, 
    ThermodynamicTemperature, 
    Time,
};

#[cfg(feature = "f32")]
pub use uom::si::f32::{
    Capacitance,
    ElectricalResistance,
    Length,
    ElectricCharge, 
    ElectricCurrent, 
    ElectricPotential, 
    Energy, 
    Power, 
    Ratio, 
    ThermodynamicTemperature, 
    Time,
};

pub use uom::fmt::DisplayStyle;
pub use uom::si::Unit;
pub use uom::si::{
    capacitance,
    electrical_resistance,
    length,
    electric_charge, 
    electric_current, 
    electric_potential, 
    energy, 
    power, 
    ratio, 
    thermodynamic_temperature, 
    time,
};

use crate::types::Float;

/// Create `Length` quantity with `meter` unit
#[inline]
pub fn meter(v: Float) -> Length{
    Length::new::<length::meter>(v)
}

/// Create `Time` quantity with `second` unit
#[inline]
pub fn second(v: Float) -> Time{
    Time::new::<time::second>(v)
}

/// Create `Time` quantity with `microsecond` unit
#[inline]
pub fn microsecond(v: Float) -> Time{
    Time::new::<time::microsecond>(v)
}

/// Create `Time` quantity with `nanosecond` unit
#[inline]
pub fn nanosecond(v: Float) -> Time{
    Time::new::<time::nanosecond>(v)
}