Skip to main content

UiShared

Struct UiShared 

Source
pub struct UiShared { /* private fields */ }
Expand description

插件面板与宿主观察线程共用的观测状态。

Implementations§

Source§

impl UiShared

Source

pub fn new() -> Self

空状态(快照空、日志空、rev 0)。

Source

pub fn update_tick(&self, t: &TickData)

落一条 tick(eTick. 裸键上屏;逐 symbol 覆盖)。

Source

pub fn tick_rows(&self) -> Vec<TickData>

tick 只读视图(排序后)。

Source

pub fn tick_groups(&self) -> Vec<(String, Vec<TickData>)>

tick 按交易所分组(行情 tab 二级 tab 键表)。

Source

pub fn tick_count(&self) -> usize

tick 库格数。

Source

pub fn order_form(&self) -> OrderForm

下单表单只读快照。

Source

pub fn set_order_form(&self, f: OrderForm)

下单表单写(渲染侧每控件改动即写)。

Source

pub fn selected_exchange(&self) -> String

选中交易所(行情二级 tab 态;行情行单击 = 带入下单面板见 render 侧)。

Source

pub fn set_selected_exchange(&self, s: impl Into<String>)

选中交易所写。

Source

pub fn topleft_tab(&self) -> TopLeftTab

左上组当前 tab。

Source

pub fn set_topleft_tab(&self, t: TopLeftTab)

左上组 tab 写。

Source

pub fn bottomright_tab(&self) -> BottomRightTab

右下组当前 tab。

Source

pub fn set_bottomright_tab(&self, t: BottomRightTab)

右下组 tab 写。

Source

pub fn theme(&self) -> Theme

当前主题(BD-UI-34)。

Source

pub fn set_theme(&self, t: Theme)

主题写。

Source

pub fn cycle_theme(&self) -> Theme

菜单钮一键循环:切到下一主题并返回。

Source

pub fn ops_window_open(&self) -> bool

运维窗开合。

Source

pub fn set_ops_window_open(&self, v: bool)

运维窗开合写。

Source

pub fn ctp_window_open(&self) -> bool

CTP 配置窗开合。

Source

pub fn set_ctp_window_open(&self, v: bool)

CTP 配置窗开合写。

Source

pub fn kline_symbols(&self) -> Vec<String>

已开 K线窗合约表(多开,去重)。

Source

pub fn open_kline(&self, symbol: impl Into<String>)

开 K线窗(去重;日志留痕可断言)。

Source

pub fn close_kline(&self, symbol: &str)

关 K线窗(窗关闭钮 → 出表)。

Source

pub fn contracts_window_open(&self) -> bool

查询合约窗开合。

Source

pub fn set_contracts_window_open(&self, v: bool)

查询合约窗开合写。

Source

pub fn update_contract(&self, c: &ContractData)

落一条合约(eContract. 裸键上屏)。

Source

pub fn contracts(&self, pattern: &str) -> Vec<ContractData>

合约查询(Python ContractManager 口径:留空 = 全部)。

Source

pub fn contract_count(&self) -> usize

合约库格数。

Source

pub fn contract_query(&self) -> String

查询串读写。

Source

pub fn set_contract_query(&self, q: impl Into<String>)

查询串写。

Source

pub fn toggle_contract_selection(&self, en_symbol: &str)

勾选翻转(en_symbol)。

Source

pub fn selected_contracts(&self) -> Vec<String>

当前勾选集。

Source

pub fn log_line(&self, line: impl Into<String>)

追加一行日志(总线面/宿主观察线程写)。

Source

pub fn clear_logs(&self)

清空日志(渲染“清空日志“按钮 / 测试)。

Source

pub fn logs_snapshot(&self) -> (Vec<String>, u64)

日志只读快照 + 溢出计数。

Source

pub fn logs_len(&self) -> usize

日志当前长度(kittest 断言用)。

Source

pub fn set_snapshot(&self, snap: BusSnap)

落一次服务快照(eTimer 节流回调)。

Source

pub fn snapshot(&self) -> Arc<BusSnap> ⓘ

当前快照(Arc 克隆,零拷贝走锁)。

Source

pub fn rev(&self) -> u64

revision:任何写入 +1(插件面 ePlug 事件也用;测试判定“有事件进来过“)。

Source

pub fn bump(&self)

手动推一次 revision(总线面 ePlugUp/Down 记账用)。

Source

pub fn request_stop(&self)

置关窗信号(eframe App 关窗钩子调用)。

Source

pub fn is_stop(&self) -> bool

观察线程轮询用。

Source

pub fn push_cmd(&self, cmd: UiCmd)

入一条操作指令(窗口面离场动作唯一通道;左位不直调)。

Source

pub fn drain_cmds(&self) -> Vec<UiCmd>

取走全部指令(eTimer 节拍辞行)。

Source

pub fn pending_confirm(&self) -> Option<String>

当前待二次确认目标(Some = 二次确认中)。

Source

pub fn confirm_step(&self, name: &str) -> ConfirmStep

确认步进:同名二点 = 发令(Fired),异名 = 迁移(Switched),首点 = 进入待确认。

Source

pub fn confirm_cancel(&self)

清除待确认(取消钮)。

Source

pub fn market(&self) -> &MarketStore

行情库直读(读写两用:worker 写,渲染读)。

Source

pub fn set_trade_snap(&self, ts: TradeSnap)

交易监控快照写(ui 插件 eTimer 拍)。

Source

pub fn trade_snap(&self) -> Arc<TradeSnap> ⓘ

交易监控快照读(渲染)。

Source

pub fn ctp_form(&self) -> CtpForm

CTP 配置表单读(渲染克隆面)。

Source

pub fn set_ctp_form(&self, f: CtpForm)

CTP 配置表单写。

Source

pub fn row_selected(&self, table: &str, key: &str) -> bool

该行是否为所属表的选中行(渲染判断;无键 = 未选)。

Source

pub fn select_row(&self, table: &str, key: &str)

设所属表的选中行(每表一行;同键重复点 = 保持)。

Trait Implementations§

Source§

impl Debug for UiShared

Source§

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

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

impl Default for UiShared

Source§

fn default() -> Self

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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