pub trait DiscNum {
fn hole() -> Self;
}
pub trait AsPlotnum {
type Target: PlotNum;
fn as_plotnum(&self) -> &Self::Target;
}
impl<P: PlotNum> AsPlotnum for P {
type Target = P;
fn as_plotnum(&self) -> &Self::Target {
self
}
}
pub trait PlotNum: PartialOrd + Copy + std::fmt::Debug {
fn is_hole(&self) -> bool;
fn scale(&self, range: &[Self; 2], max: f64) -> f64;
fn unit_range(offset: Option<Self>) -> [Self; 2];
}
pub trait HasDefaultTicks: Sized {
type DefaultTicks: crate::ticks::TickDistGen<Self>;
fn default_ticks() -> Self::DefaultTicks;
}
use std::fmt;
pub trait BaseFmt {
fn write_title(&self, writer: &mut dyn fmt::Write) -> fmt::Result;
fn write_xname(&self, writer: &mut dyn fmt::Write) -> fmt::Result;
fn write_yname(&self, writer: &mut dyn fmt::Write) -> fmt::Result;
}
pub trait HasZero {
fn zero() -> Self;
}