DataPoint

Trait DataPoint 

Source
pub trait DataPoint:
    Copy
    + Clone
    + PartialEq {
    type X: PartialOrd + Copy + Clone;
    type Y: PartialOrd + Copy + Clone;

    // Required methods
    fn x(&self) -> Self::X;
    fn y(&self) -> Self::Y;
    fn new(x: Self::X, y: Self::Y) -> Self;
}
Expand description

Trait for data points that can be used in charts

Required Associated Types§

Source

type X: PartialOrd + Copy + Clone

The type of the X coordinate

Source

type Y: PartialOrd + Copy + Clone

The type of the Y coordinate

Required Methods§

Source

fn x(&self) -> Self::X

Get the X coordinate of this data point

Source

fn y(&self) -> Self::Y

Get the Y coordinate of this data point

Source

fn new(x: Self::X, y: Self::Y) -> Self

Create a new data point from X and Y coordinates

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.

Implementors§