[][src]Struct cxmr_feeds::EventData

pub struct EventData {
    pub ts: u64,
    pub is_trade: bool,
    pub is_bid: bool,
    pub rate: f32,
    pub amount: f32,
}

Tectonic data row.

Fields

ts: u64

Event timestamp.

is_trade: bool

True if event is trade. It's order if false.

is_bid: bool

True if event is bid. It's ask if false.

rate: f32

Order or trade price.

amount: f32

Order or trade quantity.

Methods

impl EventData[src]

pub fn from_event(event: &Event, ts: u64) -> Result<EventData, Error>[src]

Constructs data row from event.

pub fn to_csv(&self) -> String[src]

Serializes to CSV with timestamp in seconds.

pub fn to_trade_csv(&self) -> String[src]

Serializes to CSV with timestamp in seconds. Prints row without is_trade column.

Trait Implementations

impl Clone for EventData[src]

impl Debug for EventData[src]

impl Default for EventData[src]

impl From<EventData> for Event[src]

impl PartialEq<EventData> for EventData[src]

Auto Trait Implementations

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> 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.