pub enum UiCmd {
Start {
factory: String,
name: String,
},
Remove {
name: String,
},
Reload {
interval: i64,
symbol: String,
bars: Vec<BarData>,
},
SendOrder {
req: OrderRequest,
gateway: String,
mode: LockMode,
},
CancelOrder {
orderid: String,
gateway: String,
},
CtpConfigure {
gateway: String,
form: CtpForm,
},
Connect {
gateway: String,
form: CtpForm,
},
CtpSubscribe {
gateway: String,
symbols: Vec<String>,
},
Disconnect {
gateway: String,
},
}Expand description
UI 操作指令(窗口面 → 总线面;eTimer 节拍被 ui 插件请辞)。
Variants§
Start
svctl.start(工厂名 + 实例注册名;name 空 = 旧行为,工厂名即注册名)。
多账号面:factory="ctp" + name=ctp_<broker>_<账号> 建第 N 个网关实例。
Remove
svctl.remove(插件名)。
Reload
dm.reload 回灌(S4;push=true 逐条广播,行情面板实时见 Rows)。
SendOrder
下单(S5;网关受理即 SUBMITTING 单上总线)。
S6 起网关可选(gateway.send_order,空 = ctp)。
0.1.1(BD-UI-30):改走 oms.submit_order 五段管线(拆单/风控/逐腿
发送/记账,parent 聚合);mode = 拆单四态(勾选「自动开平」= Auto,
取消勾选 = None 原样旁路)。
CancelOrder
撤单(S5;携三段号所需的 orderid;S6 起网关同选)。
0.1.1(BD-UI-30):改走 oms.cancel_order(守卫 4000 不可绕过;
symbol/exchange 由 oms 订单缓存解,不再随令携带)。
CtpConfigure
{gw}.configure 账户配置(多账号面:网关名随令携带,不再硬编码 ctp;
出队时 to_configure_req 抬成线上契约)。
0.2.18 起界面侧不再用它装配账户(装配走 Connect);保留作低层口与测试面。
Connect
四态分离的「连接」(0.2.18,规划裁定:添加 ≠ 连接):
一次做完 svctl.start(factory=ctp) + {gw}.configure,结果回写账户行
(Assembling → Assembled / AssembleFailed)。界面『连接』『重试』钮走这一条,
『添加账户』只写清册(不再一键装配 → 失败不会留下“注定被拒“的半死行)。
CtpSubscribe
{gw}.subscribe 订阅行情(多账号面:一律路由到行情元账号,
从账号没有 MD 会话,发给它只会静默成功 —— 见规划 §5.C / §9.4-21)。
Disconnect
{gw}.disconnect 停会话(0.2.19,规划裁定 1:断开 ≠ 移除):
网关实例、账号配置、订阅集、状态计数全保留,『连接/重试』可恢复(重登自动重订阅)。
『移除』走的 UiCmd::Remove(svctl.remove)才是停实例 —— 两个动作不得混成一个。
Trait Implementations§
impl StructuralPartialEq for UiCmd
Auto Trait Implementations§
impl Freeze for UiCmd
impl RefUnwindSafe for UiCmd
impl Send for UiCmd
impl Sync for UiCmd
impl Unpin for UiCmd
impl UnsafeUnpin for UiCmd
impl UnwindSafe for UiCmd
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.