pub struct Ticker {
pub time: String,
pub sequence: i64,
pub dir: i32,
pub price: f64,
pub volume: i64,
pub turnover: f64,
pub recv_time: Option<f64>,
pub type: Option<i32>,
pub type_sign: Option<i32>,
pub push_data_type: Option<i32>,
pub timestamp: Option<f64>,
}Fields§
§time: String时间字符串
sequence: i64唯一标识
dir: i32TickerDirection, 买卖方向
price: f64价格
volume: i64成交量
turnover: f64成交额
recv_time: Option<f64>收到推送数据的本地时间戳,用于定位延迟
type: Option<i32>TickerType, 逐笔类型
type_sign: Option<i32>逐笔类型符号
push_data_type: Option<i32>用于区分推送情况
timestamp: Option<f64>时间戳
Implementations§
Source§impl Ticker
impl Ticker
Sourcepub fn recv_time(&self) -> f64
pub fn recv_time(&self) -> f64
Returns the value of recv_time, or the default value if recv_time is unset.
Sourcepub fn type_sign(&self) -> i32
pub fn type_sign(&self) -> i32
Returns the value of type_sign, or the default value if type_sign is unset.
Sourcepub fn push_data_type(&self) -> i32
pub fn push_data_type(&self) -> i32
Returns the value of push_data_type, or the default value if push_data_type is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ticker
impl<'de> Deserialize<'de> for Ticker
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for Ticker
impl Message for Ticker
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Ticker
Auto Trait Implementations§
impl Freeze for Ticker
impl RefUnwindSafe for Ticker
impl Send for Ticker
impl Sync for Ticker
impl Unpin for Ticker
impl UnwindSafe for Ticker
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