ValNum

Trait ValNum 

Source
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.

Required Methods§

Source

fn val_num_f32(self) -> f32

Called by the Val helper functions to convert the implementing type to an f32 that can be used by Val.

Implementations on Foreign Types§

Source§

impl ValNum for f32

Source§

impl ValNum for f64

Source§

impl ValNum for i8

Source§

impl ValNum for i16

Source§

impl ValNum for i32

Source§

impl ValNum for i64

Source§

impl ValNum for isize

Source§

impl ValNum for u8

Source§

impl ValNum for u16

Source§

impl ValNum for u32

Source§

impl ValNum for u64

Source§

impl ValNum for usize

Implementors§