Trait widgetry::widgets::plots::Axis

source ·
pub trait Axis<T>: 'static + Copy + Ord + Default {
    // Required methods
    fn from_percent(&self, percent: f64) -> T;
    fn to_percent(self, max: T) -> f64;
    fn prettyprint(self, unit_fmt: &UnitFmt) -> String;
    fn to_f64(self) -> f64;
    fn from_f64(&self, x: f64) -> T;
    fn zero() -> T;
}

Required Methods§

source

fn from_percent(&self, percent: f64) -> T

source

fn to_percent(self, max: T) -> f64

source

fn prettyprint(self, unit_fmt: &UnitFmt) -> String

source

fn to_f64(self) -> f64

source

fn from_f64(&self, x: f64) -> T

source

fn zero() -> T

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Axis<usize> for usize

source§

fn from_percent(&self, percent: f64) -> usize

source§

fn to_percent(self, max: usize) -> f64

source§

fn prettyprint(self, _: &UnitFmt) -> String

source§

fn to_f64(self) -> f64

source§

fn from_f64(&self, x: f64) -> usize

source§

fn zero() -> usize

source§

impl Axis<Distance> for Distance

source§

fn from_percent(&self, percent: f64) -> Distance

source§

fn to_percent(self, max: Distance) -> f64

source§

fn prettyprint(self, unit_fmt: &UnitFmt) -> String

source§

fn to_f64(self) -> f64

source§

fn from_f64(&self, x: f64) -> Distance

source§

fn zero() -> Distance

source§

impl Axis<Duration> for Duration

source§

fn from_percent(&self, percent: f64) -> Duration

source§

fn to_percent(self, max: Duration) -> f64

source§

fn prettyprint(self, _: &UnitFmt) -> String

source§

fn to_f64(self) -> f64

source§

fn from_f64(&self, x: f64) -> Duration

source§

fn zero() -> Duration

source§

impl Axis<Time> for Time

source§

fn from_percent(&self, percent: f64) -> Time

source§

fn to_percent(self, max: Time) -> f64

source§

fn prettyprint(self, _: &UnitFmt) -> String

source§

fn to_f64(self) -> f64

source§

fn from_f64(&self, x: f64) -> Time

source§

fn zero() -> Time

Implementors§