pub trait Sequence<T>: AsRef<[T]> {
fn validate(&self) -> bool;
fn call<M>(&self, method: &mut M) -> Vec<M::Output>
where
M: Method<Input = T>,
{ ... }
fn apply<M>(&mut self, method: &mut M)
where
M: Method<Input = T, Output = T>,
Self: AsMut<[T]>,
{ ... }
fn get_initial_value(&self) -> Option<&T> { ... }
fn get_initial_value_mut(&mut self) -> Option<&mut T>
where
Self: AsMut<[T]>,
{ ... }
fn collapse_timeframe(&self, size: usize, continuous: bool) -> Vec<T>
where
T: OHLCV + Clone + Add<Output = T>,
{ ... }
}
Expand description
Implements some methods for sequence manipulations.
Required methods
Provided methods
Calls Method
over the slice and returns Vec
of result values.
Applies Method
on the slice in-place.
fn get_initial_value(&self) -> Option<&T>
fn get_initial_value(&self) -> Option<&T>
Returns a reference to the first value in the sequence or None
if it’s empty.
Returns a reference to the first value in the sequence or None
if it’s empty.
Converts timeframe of the series
See also CollapseTimeframe
method.