[−][src]Struct cxmr_snapshots::Snapshot
Snapshot of market data.
Fields
market: Option<Market>
Market symbol.
start_time: Option<u64>
Timestamp of first event.
interval: u64
Snapshot interval in milliseconds.
states: Vec<State>
Vector of snapshot.
Methods
impl Snapshot
[src]
pub fn open<P: AsRef<Path>>(path: P, interval: u64) -> Result<Snapshot, Error>
[src]
Opens DTF file from path and collects a snapshot.
pub fn open_full<P: AsRef<Path>>(
path: P,
interval: u64
) -> Result<Snapshot, Error>
[src]
path: P,
interval: u64
) -> Result<Snapshot, Error>
Opens DTF file from path and collects a snapshot.
pub fn into_close(self) -> Snapshot
[src]
Filters states into close states.
pub fn downscale(&self, interval: u64) -> Option<Snapshot>
[src]
Downscales snapshots into longer intervals.
Returns None
if interval is <= current.
pub fn id(&self) -> Option<SnapshotId>
[src]
Returns snapshot identifier.
pub fn open_ts(&self) -> Option<f32>
[src]
Returns snapshot open rate.
pub fn close_ts(&self) -> Option<f32>
[src]
Returns snapshot close rate.
pub fn first_ts(&self) -> Option<u64>
[src]
Returns timestamp of first candle.
pub fn last_ts(&self) -> Option<u64>
[src]
Returns timestamp of last candle.
pub fn candle_ts(&self, index: usize) -> Option<u64>
[src]
Calculates timestamp of candle by index.
pub fn duration(&self) -> Option<u64>
[src]
Returns total duration of snapshot.
pub fn len(&self) -> usize
[src]
Returns total amount of candles.
Trait Implementations
impl Clone for Snapshot
[src]
impl Debug for Snapshot
[src]
impl Default for Snapshot
[src]
impl<'_> From<&'_ Snapshot> for Vec<EventData>
[src]
impl PartialEq<Snapshot> for Snapshot
[src]
impl StructuralPartialEq for Snapshot
[src]
Auto Trait Implementations
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnwindSafe for Snapshot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,