DataSeries

Trait DataSeries 

Source
pub trait DataSeries {
    type Item: DataPoint;
    type Iter: Iterator<Item = Self::Item>;

    // Required methods
    fn iter(&self) -> Self::Iter;
    fn len(&self) -> usize;
    fn get(&self, index: usize) -> Option<Self::Item>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn calculate_bounds(&self) -> DataResult<()> { ... }
}
Expand description

Trait for data series that can be used in charts

Required Associated Types§

Source

type Item: DataPoint

The type of data points in this series

Source

type Iter: Iterator<Item = Self::Item>

Iterator type for iterating over data points (cloning)

Required Methods§

Source

fn iter(&self) -> Self::Iter

Get an iterator over the data points (clones items)

Source

fn len(&self) -> usize

Get the number of data points in the series

Source

fn get(&self, index: usize) -> Option<Self::Item>

Get a specific data point by index

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the series is empty

Source

fn calculate_bounds(&self) -> DataResult<()>

Calculate the bounds of this data series

Implementors§

Source§

impl<T, const N: usize> DataSeries for SlidingWindowSeries<T, N>
where T: DataPoint + Copy,

Available on crate feature animations only.
Source§

impl<T, const N: usize> DataSeries for StaticDataSeries<T, N>
where T: DataPoint + Clone,