AxisValue

Trait AxisValue 

Source
pub trait AxisValue:
    Copy
    + PartialOrd
    + Display {
    // Required methods
    fn to_f32(self) -> f32;
    fn from_f32(value: f32) -> Self;
    fn nice_step(range: Self) -> Self;
    fn format(&self) -> String<16>;
}
Expand description

Trait for types that can be used as axis values

Required Methods§

Source

fn to_f32(self) -> f32

Convert to f32 for calculations

Source

fn from_f32(value: f32) -> Self

Create from f32

Source

fn nice_step(range: Self) -> Self

Get a nice step size for this value type

Source

fn format(&self) -> String<16>

Format this value for display

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.

Implementations on Foreign Types§

Source§

impl AxisValue for f32

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> Self

Source§

fn nice_step(range: Self) -> Self

Source§

fn format(&self) -> String<16>

Source§

impl AxisValue for i32

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> Self

Source§

fn nice_step(range: Self) -> Self

Source§

fn format(&self) -> String<16>

Implementors§