pub struct UiShared { /* private fields */ }Expand description
插件面板与宿主观察线程共用的观测状态。
Implementations§
Sourcepub fn update_tick(&self, t: &TickData)
pub fn update_tick(&self, t: &TickData)
落一条 tick(eTick. 裸键上屏;逐 symbol 覆盖)。
Sourcepub fn tick_count(&self) -> usize
pub fn tick_count(&self) -> usize
tick 库格数。
Sourcepub fn order_form(&self) -> OrderForm
pub fn order_form(&self) -> OrderForm
下单表单只读快照。
Sourcepub fn set_order_form(&self, f: OrderForm)
pub fn set_order_form(&self, f: OrderForm)
下单表单写(渲染侧每控件改动即写)。
Sourcepub fn selected_exchange(&self) -> String
pub fn selected_exchange(&self) -> String
选中交易所(行情二级 tab 态;行情行单击 = 带入下单面板见 render 侧)。
Sourcepub fn set_selected_exchange(&self, s: impl Into<String>)
pub fn set_selected_exchange(&self, s: impl Into<String>)
选中交易所写。
Sourcepub fn topleft_tab(&self) -> TopLeftTab
pub fn topleft_tab(&self) -> TopLeftTab
左上组当前 tab。
Sourcepub fn set_topleft_tab(&self, t: TopLeftTab)
pub fn set_topleft_tab(&self, t: TopLeftTab)
左上组 tab 写。
Sourcepub fn bottomright_tab(&self) -> BottomRightTab
pub fn bottomright_tab(&self) -> BottomRightTab
右下组当前 tab。
Sourcepub fn set_bottomright_tab(&self, t: BottomRightTab)
pub fn set_bottomright_tab(&self, t: BottomRightTab)
右下组 tab 写。
Sourcepub fn cycle_theme(&self) -> Theme
pub fn cycle_theme(&self) -> Theme
菜单钮一键循环:切到下一主题并返回。
Sourcepub fn ops_window_open(&self) -> bool
pub fn ops_window_open(&self) -> bool
运维窗开合。
Sourcepub fn set_ops_window_open(&self, v: bool)
pub fn set_ops_window_open(&self, v: bool)
运维窗开合写。
Sourcepub fn accounts_window_open(&self) -> bool
pub fn accounts_window_open(&self) -> bool
账户面板开合。
Sourcepub fn set_accounts_window_open(&self, v: bool)
pub fn set_accounts_window_open(&self, v: bool)
账户面板开合写。
Sourcepub fn accounts(&self) -> Vec<AccountRow>
pub fn accounts(&self) -> Vec<AccountRow>
账户清单只读视图(注册序)。
Sourcepub fn account(&self, gateway: &str) -> Option<AccountRow>
pub fn account(&self, gateway: &str) -> Option<AccountRow>
单行账户查询。
Sourcepub fn add_account(&self, row: AccountRow) -> Result<(), String>
pub fn add_account(&self, row: AccountRow) -> Result<(), String>
新增一行账户。
Err(原因) = 派生名已存在(同 broker+账号重复添加)。宿主侧还有第二道
Duplicate 守卫;界面侧先拦是为了不建出一个“注定被拒“的 start 请求。
Sourcepub fn update_account_form(&self, gateway: &str, form: CtpForm) -> bool
pub fn update_account_form(&self, gateway: &str, form: CtpForm) -> bool
更新一行账户的表单留档(按 gateway 主键;不存在 = false)。
Sourcepub fn remove_account(&self, gateway: &str) -> bool
pub fn remove_account(&self, gateway: &str) -> bool
摘除一行账户(界面侧清册;网关实例由 UiCmd::Remove 走 svctl 摘)。
Sourcepub fn sync_accounts_connected(&self, rows: &[PlugRow]) -> Vec<String>
pub fn sync_accounts_connected(&self, rows: &[PlugRow]) -> Vec<String>
用 svctl 快照回填账户在场位;回带本轮新装配的网关名(订阅重放用)。
Sourcepub fn accounts_locked(&self) -> bool
pub fn accounts_locked(&self) -> bool
是否已有账户装配 —— 元账号锁定判定(规划 D3:连接后不允许切换)。
Sourcepub fn set_md_source(&self, gateway: &str) -> Result<(), String>
pub fn set_md_source(&self, gateway: &str) -> Result<(), String>
指定行情元账号(仅配置阶段;任何账户已连接 = 拒,界面须提示“先断开“)。
Sourcepub fn subscriptions(&self) -> Vec<String>
pub fn subscriptions(&self) -> Vec<String>
订阅集只读视图。
Sourcepub fn note_subscriptions(&self, symbols: &[String])
pub fn note_subscriptions(&self, symbols: &[String])
登记订阅(去重保序;断开重连后按它重放)。
Sourcepub fn default_gateway(&self) -> Option<String>
pub fn default_gateway(&self) -> Option<String>
下单默认账户阶梯(替代旧“空 → 字面量 ctp“兜底,规划 §5.B):
上次手动选择 → 第一个已连接账户 → 第一个账户;一个都没有 = None
(界面据此禁用下单钮)。
Sourcepub fn kline_symbols(&self) -> Vec<String>
pub fn kline_symbols(&self) -> Vec<String>
已开 K线窗合约表(多开,去重)。
Sourcepub fn open_kline(&self, symbol: impl Into<String>)
pub fn open_kline(&self, symbol: impl Into<String>)
开 K线窗(去重;日志留痕可断言)。
Sourcepub fn close_kline(&self, symbol: &str)
pub fn close_kline(&self, symbol: &str)
关 K线窗(窗关闭钮 → 出表)。
Sourcepub fn contracts_window_open(&self) -> bool
pub fn contracts_window_open(&self) -> bool
查询合约窗开合。
Sourcepub fn set_contracts_window_open(&self, v: bool)
pub fn set_contracts_window_open(&self, v: bool)
查询合约窗开合写。
Sourcepub fn update_contract(&self, c: &ContractData)
pub fn update_contract(&self, c: &ContractData)
落一条合约(eContract. 裸键上屏)。
Sourcepub fn contracts(&self, pattern: &str) -> Vec<ContractData>
pub fn contracts(&self, pattern: &str) -> Vec<ContractData>
合约查询(Python ContractManager 口径:留空 = 全部)。
Sourcepub fn contract_count(&self) -> usize
pub fn contract_count(&self) -> usize
合约库格数。
Sourcepub fn contract_query(&self) -> String
pub fn contract_query(&self) -> String
查询串读写。
Sourcepub fn set_contract_query(&self, q: impl Into<String>)
pub fn set_contract_query(&self, q: impl Into<String>)
查询串写。
Sourcepub fn toggle_contract_selection(&self, en_symbol: &str)
pub fn toggle_contract_selection(&self, en_symbol: &str)
勾选翻转(en_symbol)。
Sourcepub fn selected_contracts(&self) -> Vec<String>
pub fn selected_contracts(&self) -> Vec<String>
当前勾选集。
Sourcepub fn clear_logs(&self)
pub fn clear_logs(&self)
清空日志(渲染“清空日志“按钮 / 测试)。
Sourcepub fn logs_snapshot(&self) -> (Vec<String>, u64)
pub fn logs_snapshot(&self) -> (Vec<String>, u64)
日志只读快照 + 溢出计数。
Sourcepub fn set_snapshot(&self, snap: BusSnap)
pub fn set_snapshot(&self, snap: BusSnap)
落一次服务快照(eTimer 节流回调)。
Sourcepub fn request_stop(&self)
pub fn request_stop(&self)
置关窗信号(eframe App 关窗钩子调用)。
Sourcepub fn drain_cmds(&self) -> Vec<UiCmd>
pub fn drain_cmds(&self) -> Vec<UiCmd>
取走全部指令(eTimer 节拍辞行)。
Sourcepub fn pending_confirm(&self) -> Option<String>
pub fn pending_confirm(&self) -> Option<String>
当前待二次确认目标(Some = 二次确认中)。
Sourcepub fn confirm_step(&self, name: &str) -> ConfirmStep
pub fn confirm_step(&self, name: &str) -> ConfirmStep
确认步进:同名二点 = 发令(Fired),异名 = 迁移(Switched),首点 = 进入待确认。
Sourcepub fn confirm_cancel(&self)
pub fn confirm_cancel(&self)
清除待确认(取消钮)。
Sourcepub fn market(&self) -> &MarketStore
pub fn market(&self) -> &MarketStore
行情库直读(读写两用:worker 写,渲染读)。
Sourcepub fn set_trade_snap(&self, ts: TradeSnap)
pub fn set_trade_snap(&self, ts: TradeSnap)
交易监控快照写(ui 插件 eTimer 拍)。
Sourcepub fn trade_snap(&self) -> Arc<TradeSnap> ⓘ
pub fn trade_snap(&self) -> Arc<TradeSnap> ⓘ
交易监控快照读(渲染)。
Sourcepub fn set_ctp_form(&self, f: CtpForm)
pub fn set_ctp_form(&self, f: CtpForm)
CTP 配置表单写。
Sourcepub fn row_selected(&self, table: &str, key: &str) -> bool
pub fn row_selected(&self, table: &str, key: &str) -> bool
该行是否为所属表的选中行(渲染判断;无键 = 未选)。
Sourcepub fn select_row(&self, table: &str, key: &str)
pub fn select_row(&self, table: &str, key: &str)
设所属表的选中行(每表一行;同键重复点 = 保持)。
Trait Implementations§
Auto Trait Implementations§
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> 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.