Skip to main content

GatewayChange

Enum GatewayChange 

Source
pub enum GatewayChange {
Show 15 variants TdConnected, TdDisconnected, TdAuthOk, TdAuthFailed, TdLoginOk, TdLoginFailed, SettlementConfirmed, ContractArrived, ContractQueryStopped, QueryRejected, MdConnected, MdDisconnected, MdLoginOk, MdLoginFailed, SubscribeRejected,
}
Expand description

状态变化种类(0.11.0 第3刀):网关状态机里值得显形的那一刻。

口径(与 GatewayStatus 的分工钉死):

  • GatewayStatus = 状态面(一直在着的读数:在不在、第几次、多久没回);
  • GatewayChange = 变化面(那一刻发生了什么的类型名);
  • GatewayStatusEvent 把两者一次到货:变化发生时随附整份快照 → 消费者零回查。

15 种是穷举清单,不是枚举可扩展的开放集:界面按 kind 去重告警、 判据按 kind 断言;加一种要同时动界面文案与判据,所以新增须走文档。

Variants§

§

TdConnected

TD 前置已连接(会话还没起,下一步是认证/登录)

§

TdDisconnected

TD 前置断开(会话作废,查询阶段回 Idle)

§

TdAuthOk

TD 授权(认证)通过

§

TdAuthFailed

TD 授权失败

§

TdLoginOk

TD 登录成功(带 FrontID/SessionID)

§

TdLoginFailed

TD 登录失败

§

SettlementConfirmed

结算单已确认(接下来问合约)

§

ContractArrived

合约已到手(接下来轮询资金/持仓)

§

ContractQueryStopped

合约查询连续未获 → 本轮查询停止(不再问资金与持仓)

§

QueryRejected

查询被拒(资金/持仓/合约任一路;连续计数在状态面里)

§

MdConnected

MD 前置已连接

§

MdDisconnected

MD 前置断开

§

MdLoginOk

MD 登录成功(订阅集自会重推)

§

MdLoginFailed

MD 登录失败

§

SubscribeRejected

MD 订阅被拒

Implementations§

Source§

impl GatewayChange

Source

pub fn kind(&self) -> &'static str

机读短名(界面去重键、判据断言都吃这个,不吃中文文案)。

Source

pub fn describe(&self, gw: &str, st: &GatewayStatus) -> String

人话文案(生产者侧生成,0.11.0 第3刀「二合一」):界面 log_line(ev.describe()) 逐字照打,不再自己拼句子 —— 人看的那行与机器读的结构同源同次到货。

前缀沿用 0.9.8 的 [链] (界面与既有判据的观感不断档);数字一律取自 随附快照(同一份事实,不会出现“文案说第 3 次、状态列说第 2 次“这种分家)。

Trait Implementations§

Source§

impl Clone for GatewayChange

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 Copy for GatewayChange

Source§

impl Debug for GatewayChange

Source§

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

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

impl Eq for GatewayChange

Source§

impl PartialEq for GatewayChange

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GatewayChange

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