Skip to main content

TdEvent

Enum TdEvent 

Source
pub enum TdEvent {
Show 15 variants FrontConnected, FrontDisconnected(i64), RspAuthenticate { error: Option<ErrorField>, }, RspUserLogin { error: Option<ErrorField>, front_id: i64, session_id: i64, }, RspSettlementInfoConfirm { error: Option<ErrorField>, }, RspQryInstrument { last: bool, row: Option<InstrumentField>, error: Option<ErrorField>, }, RspQryInvestorPosition { last: bool, row: Option<InvestorPositionField>, error: Option<ErrorField>, }, RspQryTradingAccount { last: bool, row: Option<TradingAccountField>, error: Option<ErrorField>, }, RspOrderInsert { error: Option<ErrorField>, req: Option<InputOrder>, }, RspOrderAction { error: Option<ErrorField>, }, RtnOrder(OrderField), RtnTrade(TradeField), RspQryInstrumentMarginRate { row: Option<InstrumentMarginRateField>, error: Option<ErrorField>, last: bool, }, RspQryInstrumentCommissionRate { row: Option<InstrumentCommissionRateField>, error: Option<ErrorField>, last: bool, }, RtnInstrumentStatus(InstrumentStatusField),
}
Expand description

TD 回报事件。

Variants§

§

FrontConnected

onFrontConnected(445)

§

FrontDisconnected(i64)

onFrontDisconnected(reason)(453)

§

RspAuthenticate

onRspAuthenticate(458-472)

Fields

§error: Option<ErrorField>

None = 成功

§

RspUserLogin

onRspUserLogin(474-490)

Fields

§error: Option<ErrorField>

None = 成功

§front_id: i64

FrontID(仅成功时有意义,原稿取 data[“FrontID”])

§session_id: i64

SessionID

§

RspSettlementInfoConfirm

onRspSettlementInfoConfirm(519-533)

Fields

§error: Option<ErrorField>

None = 成功

§

RspQryInstrument

onRspQryInstrument(614-667)

Fields

§last: bool

是否本包最后一笔

§row: Option<InstrumentField>

数据行(错误包时 None)

§error: Option<ErrorField>

查询被拒(0.9.1 新增;None = 这一包没有错误回报)。

0.9.0 给轮转两查询(资金/持仓)补了这一位,合约查询刻意留在 3 参 (D-NATIVE-AUDIT-REPAID 的「划界」)。0.9.1 把它补齐:三条查询路同式, 「合约一条都没到手」与「柜台没有合约」不再长得一样(合约表空 → 持仓/委托回报的乘数与勾选判定全瞎,而界面上只是「合约窗没数」)。

§

RspQryInvestorPosition

onRspQryInvestorPosition(535-595)

Fields

§last: bool

是否本包最后一笔

§error: Option<ErrorField>

查询被拒(0.9.0 新增;None = 这一包没有错误回报)。 状态口 {gw}.status 的「查询被拒计数」事实源 —— 0.8.0 之前这一路只有 row: None,分不清「被拒」与「没有持仓」(F2 掉线后查询断供在界面上不可见)。

§

RspQryTradingAccount

onRspQryTradingAccount(597-612)

Fields

§last: bool

是否本包最后一笔

§error: Option<ErrorField>

查询被拒(0.9.0 新增;口径同 TdEvent::RspQryInvestorPosition 的 error)。

§

RspOrderInsert

onRspOrderInsert(492-513)。原稿从 err 包 OrderRef/Direction/LimitPrice 等 字段重造 REJECTED 单。

Fields

§error: Option<ErrorField>

None = 成功受理(原稿只在 error 分支造单)

§req: Option<InputOrder>

触发失败的报单原字段(transport 层随错误回报回带)

§

RspOrderAction

onRspOrderAction(515-517)

Fields

§error: Option<ErrorField>

None = 成功

§

RtnOrder(OrderField)

onRtnOrder(669-718)

§

RtnTrade(TradeField)

onRtnTrade(720-747)

§

RspQryInstrumentMarginRate

onRspQryInstrumentMarginRate。原稿无此路径 —— 端口按设计记录进 eLog (不新增事件实体,记档见 DESIGN)。

Fields

§error: Option<ErrorField>

查询错误(超出设计错误面:查询没就绪等)

§last: bool

是否本包最后一笔

§

RspQryInstrumentCommissionRate

onRspQryInstrumentCommissionRate。原稿无此路径 —— 同上,记录进 eLog。

Fields

§error: Option<ErrorField>

查询错误

§last: bool

是否本包最后一笔

§

RtnInstrumentStatus(InstrumentStatusField)

onRtnInstrumentStatus(纯被动推送;SDK 6.7.7 无对应 Req)。原稿无此路径。

Trait Implementations§

Source§

impl Clone for TdEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TdEvent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more