danwi 0.4.2

Zero-cost dimensional analysis library with SI units, compile-time checking, and no_std support
Documentation
//! Scalar numeric types usable as the value of a [`Quantity`](crate::Quantity).
//!
//! `Scalar` is a compositional bound: it combines the operator and
//! formatting traits that [`Quantity`](crate::Quantity) needs into a single
//! name so that impl signatures stay readable.
//!
//! The trait is sealed: only `f32` and `f64` implement it (when their
//! respective crate features are enabled). This keeps the set of supported
//! scalar types closed on purpose.

mod apply;
mod float;

use core::{
    fmt::{Debug, Display},
    ops::{Add, Div, Mul, Neg, Sub},
};

pub use apply::*;

pub trait Scalar:
    sealed::Sealed
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self>
    + Copy
    + Debug
    + Display
    + PartialEq
    + PartialOrd
    + Sized
{
}

pub(crate) mod sealed {
    pub trait Sealed {}
}