pub trait UnitSqrt: Unit {
type Root: Unit;
}Expand description
Inverse of squaring at the type level: maps a “squared” unit back to its scalar root unit.
Implemented blanketly for Prod<U, U>, so any unit that arises as
the dimensional square of another unit (e.g. Prod<Meter, Meter> ≡
SquareMeter) carries a Root = U and can be square-rooted via
Quantity::sqrt.
This is the dimensionally correct inverse of the Quantity<U> * Quantity<U> -> Quantity<Prod<U, U>> Mul impl provided through
UnitMul.
§Note
The blanket impl deliberately only covers the symmetric product
Prod<U, U>; mixed products like Prod<Meter, Second> have no
well-defined square root in this system.
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.