How can you specify a uom
type (Quantity
) with arbitrary dimensions?
For example, imagine that at some point in my code I want/need to declare that some value has units of length-1, or mass3✕current2✕time-2. Rather than tracking down some pre-existing named Quantity
with those dimensions (which, in general, won't exist) I'd like to state in a not-too-verbose way that the dimensions of this quantity right here are these. Close to ideal would be something like:
let foo: Quantity<L = N1> = todo!();
let bar: Quantitiy<M = P3, I = P2, T = N2> = todo!();
and I couldn't really ask for better than
let foo: units!(L = 1) = todo!();
let bar: units!(M = 3, I = 2, T = -2) = todo!();
Is it possible to specify ad-hoc quantities at all?