pub struct OhlcvView<'a> { /* private fields */ }Expand description
Validated borrowed candles. Prices and volume accept F32 or F64 columns; timestamps are I64. Source columns remain immutable while this view exists.
Implementations§
Source§impl<'a> OhlcvView<'a>
impl<'a> OhlcvView<'a>
Sourcepub fn new_from_frame(frame: &'a DataFrame, unit: UnixTimeUnit) -> Result<Self>
pub fn new_from_frame(frame: &'a DataFrame, unit: UnixTimeUnit) -> Result<Self>
Borrow timestamp/open/high/low/close/volume columns by their standard names.
§Errors
Rejects missing/wrongly typed columns, non-finite values, negative volume, inconsistent candle bounds, or timestamps not strictly increasing.
Sourcepub fn new_from_frame_view(
frame: DataFrameView<'a>,
unit: UnixTimeUnit,
) -> Result<Self>
pub fn new_from_frame_view( frame: DataFrameView<'a>, unit: UnixTimeUnit, ) -> Result<Self>
Validate and borrow candles inside one existing frame row partition.
§Errors
Uses the same column, timestamp and candle validation as from_frame.
Sourcepub fn timestamps(self) -> &'a [i64]
pub fn timestamps(self) -> &'a [i64]
Exact timestamp storage.
Sourcepub fn time_unit(self) -> UnixTimeUnit
pub fn time_unit(self) -> UnixTimeUnit
Timestamp unit, preserved by every view.
Sourcepub fn columns(self) -> [SeriesView<'a>; 5]
pub fn columns(self) -> [SeriesView<'a>; 5]
Columns in open/high/low/close/volume order.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for OhlcvView<'a>
impl<'a> Freeze for OhlcvView<'a>
impl<'a> Move for OhlcvView<'a>
impl<'a> RefUnwindSafe for OhlcvView<'a>
impl<'a> Send for OhlcvView<'a>
impl<'a> Sync for OhlcvView<'a>
impl<'a> Unpin for OhlcvView<'a>
impl<'a> UnsafeUnpin for OhlcvView<'a>
impl<'a> UnwindSafe for OhlcvView<'a>
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