Struct dbn::record::Mbp1Msg

source ·
#[repr(C)]
pub struct Mbp1Msg { pub hd: RecordHeader, pub price: i64, pub size: u32, pub action: c_char, pub side: c_char, pub flags: u8, pub depth: u8, pub ts_recv: u64, pub ts_in_delta: i32, pub sequence: u32, pub booklevel: [BidAskPair; 1], }
Expand description

Market by price implementation with a known book depth of 1. The record of the Mbp1 schema.

Fields§

§hd: RecordHeader

The common header.

§price: i64

The order price expressed as a signed integer where every 1 unit corresponds to 1e-9, i.e. 1/1,000,000,000 or 0.000000001.

§size: u32

The order quantity.

§action: c_char

The event action. Can be Add, Cancel, Modify, cleaR, or Trade.

§side: c_char

The order side. Can be Ask, Bid or None.

§flags: u8

A combination of packet end with matching engine status. See enums::flags for possible values.

§depth: u8

The depth of actual book change.

§ts_recv: u64

The capture-server-received timestamp expressed as number of nanoseconds since the UNIX epoch.

§ts_in_delta: i32

The delta of ts_recv - ts_exchange_send, max 2 seconds.

§sequence: u32

The message sequence number assigned at the venue.

§booklevel: [BidAskPair; 1]

The top of the order book.

Implementations§

source§

impl Mbp1Msg

source

pub fn side(&self) -> Result<Side>

Tries to convert the raw side to an enum.

Errors

This function returns an error if the side field does not contain a valid Side.

source

pub fn action(&self) -> Result<Action>

Tries to convert the raw action to an enum.

Errors

This function returns an error if the action field does not contain a valid Action.

Trait Implementations§

source§

impl AsRef<[u8]> for Mbp1Msg

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Mbp1Msg

source§

fn clone(&self) -> Mbp1Msg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mbp1Msg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl HasRType for Mbp1Msg

Mbp1Msg’s type ID is the size of its booklevel array.

source§

fn has_rtype(rtype: u8) -> bool

Returns true if rtype matches the value associated with the implementing type.
source§

fn header(&self) -> &RecordHeader

Returns a reference to the RecordHeader that comes at the beginning of all record types.
source§

fn header_mut(&mut self) -> &mut RecordHeader

Returns a mutable reference to the RecordHeader that comes at the beginning of all record types.
source§

fn record_size(&self) -> usize

Returns the size of the record in bytes.
source§

impl PartialEq<Mbp1Msg> for Mbp1Msg

source§

fn eq(&self, other: &Mbp1Msg) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Mbp1Msg

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Mbp1Msg

source§

impl StructuralEq for Mbp1Msg

source§

impl StructuralPartialEq for Mbp1Msg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DbnEncodable for Twhere T: HasRType + AsRef<[u8]> + CsvSerialize + Debug + Serialize,