pub trait LttbSource {
type Item;
// Required methods
fn len(&self) -> usize;
fn item_at(&self, i: usize) -> Self::Item;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn cast<T, F>(self, f: F) -> Cast<Self, T, F>
where Self: Sized,
T: DataPoint,
F: Fn(Self::Item) -> T { ... }
fn lttb(self, threshold: usize) -> LttbIterator<Self> ⓘ
where Self: Sized,
Self::Item: DataPoint { ... }
}
Expand description
Required Associated Types§
Sourcetype Item
type Item
data item of LttbSource
Required Methods§
Sourcefn len(&self) -> usize
fn len(&self) -> usize
length of LttbSource
Provided Methods§
Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
is LttbSource
empty
Sourcefn cast<T, F>(self, f: F) -> Cast<Self, T, F>
fn cast<T, F>(self, f: F) -> Cast<Self, T, F>
map data item to another type.
- if the data item type of
LttbSource
is notDataPoint
, lttb sampling can be used after casting