pub trait ValNum {
// Required method
fn val_num_f32(self) -> f32;
}
Expand description
All the types that should be able to be used in the Val
enum should implement this trait.
Instead of just implementing Into<Val>
a custom trait is added.
This is done in order to prevent having to define a default unit, which could lead to confusion especially for newcomers.