[][src]Struct cxmr_snapshots::State

pub struct State {
    pub candle: Candle,
    pub update: UpdateKind,
    pub orderbook: OrderBook,
}

Cached state for a replay.

Fields

candle: Candle

Candle data.

update: UpdateKind

Candle state update kind.

orderbook: OrderBook

Order book on close.

Methods

impl State[src]

pub fn new(update: UpdateState, orderbook: OrderBook) -> Self[src]

Creates new state.

pub fn new_close(candle: Candle, orderbook: OrderBook) -> Self[src]

Creates new state close.

pub fn time(&self) -> u64[src]

Returns timestamp of a candle.

pub fn update(&mut self, row: &EventData)[src]

Updates state with given data row.

pub fn into_close(self) -> Option<State>[src]

Returns inner state if update is close.

Trait Implementations

impl AsRef<Candle> for State[src]

impl AsRef<State> for State[src]

impl Clone for State[src]

impl Close for State[src]

impl Debug for State[src]

impl<'_> From<&'_ State> for Vec<EventData>[src]

impl High for State[src]

impl Low for State[src]

impl Open for State[src]

impl OrderBook for State[src]

impl PartialEq<State> for State[src]

impl StructuralPartialEq for State[src]

impl Time for State[src]

impl Volume for State[src]

Auto Trait Implementations

impl RefUnwindSafe for State

impl Send for State

impl Sync for State

impl Unpin for State

impl UnwindSafe for State

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> State for T where
    T: OrderBook + Time + Open + Close + Low + High + Volume, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.