pub trait Sequence<T>: AsRef<[T]> {
// Required method
fn validate(&self) -> bool;
// Provided methods
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§
sourcefn call<M>(&self, method: &mut M) -> Vec<M::Output>where
M: Method<Input = T>,
fn call<M>(&self, method: &mut M) -> Vec<M::Output>where
M: Method<Input = T>,
Calls Method
over the slice and returns Vec
of result values.
sourcefn 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.
sourcefn get_initial_value_mut(&mut self) -> Option<&mut T>
fn get_initial_value_mut(&mut self) -> Option<&mut T>
Returns a reference to the first value in the sequence or None
if it’s empty.
sourcefn collapse_timeframe(&self, size: usize, continuous: bool) -> Vec<T>
fn collapse_timeframe(&self, size: usize, continuous: bool) -> Vec<T>
Converts timeframe of the series
See also CollapseTimeframe
method.
Object Safety§
This trait is not object safe.