pub struct BacktestDataIterator { /* private fields */ }
Expand description
Multi-stream, time-ordered data iterator used by the backtest engine.
Implementations§
Source§impl BacktestDataIterator
impl BacktestDataIterator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty BacktestDataIterator
.
Sourcepub fn add_data(&mut self, name: &str, data: Vec<Data>, append_data: bool)
pub fn add_data(&mut self, name: &str, data: Vec<Data>, append_data: bool)
Add (or replace) a named data stream. append_data=true
gives the stream
lower priority when timestamps tie, mirroring the original behaviour.
Sourcepub fn remove_data(&mut self, name: &str, complete_remove: bool)
pub fn remove_data(&mut self, name: &str, complete_remove: bool)
Remove a stream. complete_remove
also discards placeholder generator
(not implemented yet).
Sourcepub fn set_index(&mut self, name: &str, index: usize)
pub fn set_index(&mut self, name: &str, index: usize)
Move cursor of stream to index
(0-based).
Sourcepub fn next(&mut self) -> Option<Data>
pub fn next(&mut self) -> Option<Data>
Return next Data element across all streams in chronological order.
pub fn is_done(&self) -> bool
Trait Implementations§
Source§impl Debug for BacktestDataIterator
impl Debug for BacktestDataIterator
Source§impl Default for BacktestDataIterator
impl Default for BacktestDataIterator
Source§fn default() -> BacktestDataIterator
fn default() -> BacktestDataIterator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BacktestDataIterator
impl RefUnwindSafe for BacktestDataIterator
impl Send for BacktestDataIterator
impl Sync for BacktestDataIterator
impl Unpin for BacktestDataIterator
impl UnwindSafe for BacktestDataIterator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more