pub struct MsgHeader {
pub req_id: Option<String>,
pub account_id: Option<u64>,
pub cipher: Option<Vec<u8>>,
pub security_type: Option<u32>,
pub exchange_code: Option<u32>,
pub input_source: Option<u32>,
pub market: Option<u32>,
}Fields§
§req_id: Option<String>请求id,唯一标识一次请求,作为重入依据生成方式参考 请求方保证唯一性 生成规则: accountid+uniqueid, 然后base64, 长度算上结尾的’\0’, 为33字节
account_id: Option<u64>64位, 可解析出market的信息, 注意解出来的跟上面的Market定义不一样, 要转换
cipher: Option<Vec<u8>>§security_type: Option<u32>交易品种,取值参考SecurityType,有些协议必须填,有些协议不需要,具体处理规则,需查看ailey整理的文档的https://docs.qq.com/doc/DRkdRUEJheEVVY090?opendocxfrom=admin 之 8、【security_type字段的处理】
exchange_code: Option<u32>期货所属交易所代码, 从订单上获取,【期货】必填
input_source: Option<u32>请求源,取值参考InputSourceType
market: Option<u32>交易市场
Implementations§
Source§impl MsgHeader
impl MsgHeader
Sourcepub fn req_id(&self) -> &str
pub fn req_id(&self) -> &str
Returns the value of req_id, or the default value if req_id is unset.
Sourcepub fn account_id(&self) -> u64
pub fn account_id(&self) -> u64
Returns the value of account_id, or the default value if account_id is unset.
Sourcepub fn cipher(&self) -> &[u8] ⓘ
pub fn cipher(&self) -> &[u8] ⓘ
Returns the value of cipher, or the default value if cipher is unset.
Sourcepub fn security_type(&self) -> u32
pub fn security_type(&self) -> u32
Returns the value of security_type, or the default value if security_type is unset.
Sourcepub fn exchange_code(&self) -> u32
pub fn exchange_code(&self) -> u32
Returns the value of exchange_code, or the default value if exchange_code is unset.
Sourcepub fn input_source(&self) -> u32
pub fn input_source(&self) -> u32
Returns the value of input_source, or the default value if input_source is unset.
Trait Implementations§
Source§impl Message for MsgHeader
impl Message for MsgHeader
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
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,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
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,
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,
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,
self.impl Eq for MsgHeader
impl StructuralPartialEq for MsgHeader
Auto Trait Implementations§
impl Freeze for MsgHeader
impl RefUnwindSafe for MsgHeader
impl Send for MsgHeader
impl Sync for MsgHeader
impl Unpin for MsgHeader
impl UnsafeUnpin for MsgHeader
impl UnwindSafe for MsgHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.