pub enum LoginState {
Unknown,
Online,
LoginFailed,
FrontDown,
QueryStarved,
Stopped,
}Expand description
登录态(0.2.19;事实源 = ek-ctp 0.9.0 {gw}.status,规划 P3 / 裁定 3)。
与 AccountStage 是两件事:stage 说「实例在不在」,这一档说「会话活着没有」。
状态列把两者拼起来(AccountRow::status_label)。
Variants§
Unknown
还没读到读数,或读到了但没有任何登录证据。
网关的「句柄已建」(td_handle_up)不等于在线 —— 掉线时它仍是真
(ek-ctp DESIGN D-STATUS ①),所以没有 logged_in 就只有这一档,不得显示「在线」。
Online
网关回报 td_logged_in(纯行情账户看 md_logged_in)—— 在线的唯一硬证据。
LoginFailed
最近一次登录失败(网关在成功后会清零这一位,所以它显形 = 现在就是登不上)。
FrontDown
柜台断过线且当前未登录(td_disconnects > 0;计数跨重连保留)。
QueryStarved
登录着但查询连续被拒 / 资金回报超时(规划 Q10 两判据,阈值在界面)。
Stopped
用户主动『断开』(规划裁定 1):会话已停,实例与订阅还在,『连接』可恢复。
Implementations§
Trait Implementations§
Source§impl Clone for LoginState
impl Clone for LoginState
impl Copy for LoginState
Source§impl Debug for LoginState
impl Debug for LoginState
Source§impl Default for LoginState
impl Default for LoginState
impl Eq for LoginState
Source§impl PartialEq for LoginState
impl PartialEq for LoginState
impl StructuralPartialEq for LoginState
Auto Trait Implementations§
impl Freeze for LoginState
impl RefUnwindSafe for LoginState
impl Send for LoginState
impl Sync for LoginState
impl Unpin for LoginState
impl UnsafeUnpin for LoginState
impl UnwindSafe for LoginState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.