pub struct AppState {Show 106 fields
pub symbol: String,
pub strategy_label: String,
pub candles: Vec<Candle>,
pub current_candle: Option<CandleBuilder>,
pub candle_interval_ms: u64,
pub timeframe: String,
pub price_history_len: usize,
pub position: Position,
pub last_signal: Option<Signal>,
pub last_order: Option<OrderUpdate>,
pub open_order_history: Vec<String>,
pub filled_order_history: Vec<String>,
pub fast_sma: Option<f64>,
pub slow_sma: Option<f64>,
pub ws_connected: bool,
pub paused: bool,
pub tick_count: u64,
pub log_messages: Vec<String>,
pub log_records: Vec<LogRecord>,
pub balances: HashMap<String, f64>,
pub initial_equity_usdt: Option<f64>,
pub current_equity_usdt: Option<f64>,
pub history_estimated_total_pnl_usdt: Option<f64>,
pub fill_markers: Vec<FillMarker>,
pub history_trade_count: u32,
pub history_win_count: u32,
pub history_lose_count: u32,
pub history_realized_pnl: f64,
pub portfolio_state: PortfolioStateSnapshot,
pub strategy_stats: HashMap<String, OrderHistoryStats>,
pub exit_policy_by_scope: HashMap<String, ExitPolicyEntry>,
pub predictor_metrics_by_scope: HashMap<String, PredictorMetricEntry>,
pub history_fills: Vec<OrderHistoryFill>,
pub last_price_update_ms: Option<u64>,
pub last_price_event_ms: Option<u64>,
pub last_price_latency_ms: Option<u64>,
pub last_order_history_update_ms: Option<u64>,
pub last_order_history_event_ms: Option<u64>,
pub last_order_history_latency_ms: Option<u64>,
pub trade_stats_reset_warned: bool,
pub symbol_selector_open: bool,
pub symbol_selector_index: usize,
pub symbol_items: Vec<String>,
pub strategy_selector_open: bool,
pub strategy_selector_index: usize,
pub strategy_items: Vec<String>,
pub strategy_item_symbols: Vec<String>,
pub strategy_item_active: Vec<bool>,
pub strategy_item_created_at_ms: Vec<i64>,
pub strategy_item_total_running_ms: Vec<u64>,
pub account_popup_open: bool,
pub history_popup_open: bool,
pub focus_popup_open: bool,
pub close_all_confirm_open: bool,
pub strategy_editor_open: bool,
pub strategy_editor_kind_category_selector_open: bool,
pub strategy_editor_kind_selector_open: bool,
pub strategy_editor_index: usize,
pub strategy_editor_field: usize,
pub strategy_editor_kind_category_items: Vec<String>,
pub strategy_editor_kind_category_index: usize,
pub strategy_editor_kind_popup_items: Vec<String>,
pub strategy_editor_kind_popup_labels: Vec<Option<String>>,
pub strategy_editor_kind_items: Vec<String>,
pub strategy_editor_kind_selector_index: usize,
pub strategy_editor_kind_index: usize,
pub strategy_editor_symbol_index: usize,
pub strategy_editor_fast: usize,
pub strategy_editor_slow: usize,
pub strategy_editor_cooldown: u64,
pub grid_symbol_index: usize,
pub grid_strategy_index: usize,
pub grid_select_on_panel: bool,
pub grid_tab: GridTab,
pub strategy_last_event_by_tag: HashMap<String, StrategyLastEvent>,
pub network_tick_drop_count: u64,
pub network_reconnect_count: u64,
pub network_tick_latencies_ms: Vec<u64>,
pub network_fill_latencies_ms: Vec<u64>,
pub network_order_sync_latencies_ms: Vec<u64>,
pub network_tick_in_timestamps_ms: Vec<u64>,
pub network_tick_drop_timestamps_ms: Vec<u64>,
pub network_reconnect_timestamps_ms: Vec<u64>,
pub network_disconnect_timestamps_ms: Vec<u64>,
pub network_last_fill_ms: Option<u64>,
pub network_pending_submit_ms_by_intent: HashMap<String, u64>,
pub history_rows: Vec<String>,
pub history_bucket: HistoryBucket,
pub last_applied_fee: String,
pub grid_open: bool,
pub ui_projection: UiProjection,
pub rate_budget_global: RateBudgetSnapshot,
pub rate_budget_orders: RateBudgetSnapshot,
pub rate_budget_account: RateBudgetSnapshot,
pub rate_budget_market_data: RateBudgetSnapshot,
pub close_all_running: bool,
pub close_all_job_id: Option<u64>,
pub close_all_total: usize,
pub close_all_completed: usize,
pub close_all_failed: usize,
pub close_all_current_symbol: Option<String>,
pub close_all_status_expire_at_ms: Option<u64>,
pub close_all_row_status_by_symbol: HashMap<String, String>,
pub hide_small_positions: bool,
pub hide_empty_predictor_rows: bool,
pub predictor_scroll_offset: usize,
}Fields§
§symbol: String§strategy_label: String§candles: Vec<Candle>§current_candle: Option<CandleBuilder>§candle_interval_ms: u64§timeframe: String§price_history_len: usize§position: Position§last_signal: Option<Signal>§last_order: Option<OrderUpdate>§open_order_history: Vec<String>§filled_order_history: Vec<String>§fast_sma: Option<f64>§slow_sma: Option<f64>§ws_connected: bool§paused: bool§tick_count: u64§log_messages: Vec<String>§log_records: Vec<LogRecord>§balances: HashMap<String, f64>§initial_equity_usdt: Option<f64>§current_equity_usdt: Option<f64>§history_estimated_total_pnl_usdt: Option<f64>§fill_markers: Vec<FillMarker>§history_trade_count: u32§history_win_count: u32§history_lose_count: u32§history_realized_pnl: f64§portfolio_state: PortfolioStateSnapshot§strategy_stats: HashMap<String, OrderHistoryStats>§exit_policy_by_scope: HashMap<String, ExitPolicyEntry>§predictor_metrics_by_scope: HashMap<String, PredictorMetricEntry>§history_fills: Vec<OrderHistoryFill>§last_price_update_ms: Option<u64>§last_price_event_ms: Option<u64>§last_price_latency_ms: Option<u64>§last_order_history_update_ms: Option<u64>§last_order_history_event_ms: Option<u64>§last_order_history_latency_ms: Option<u64>§trade_stats_reset_warned: bool§symbol_selector_open: bool§symbol_selector_index: usize§symbol_items: Vec<String>§strategy_selector_open: bool§strategy_selector_index: usize§strategy_items: Vec<String>§strategy_item_symbols: Vec<String>§strategy_item_active: Vec<bool>§strategy_item_created_at_ms: Vec<i64>§strategy_item_total_running_ms: Vec<u64>§account_popup_open: bool§history_popup_open: bool§focus_popup_open: bool§close_all_confirm_open: bool§strategy_editor_open: bool§strategy_editor_kind_category_selector_open: bool§strategy_editor_kind_selector_open: bool§strategy_editor_index: usize§strategy_editor_field: usize§strategy_editor_kind_category_items: Vec<String>§strategy_editor_kind_category_index: usize§strategy_editor_kind_popup_items: Vec<String>§strategy_editor_kind_popup_labels: Vec<Option<String>>§strategy_editor_kind_items: Vec<String>§strategy_editor_kind_selector_index: usize§strategy_editor_kind_index: usize§strategy_editor_symbol_index: usize§strategy_editor_fast: usize§strategy_editor_slow: usize§strategy_editor_cooldown: u64§grid_symbol_index: usize§grid_strategy_index: usize§grid_select_on_panel: bool§grid_tab: GridTab§strategy_last_event_by_tag: HashMap<String, StrategyLastEvent>§network_tick_drop_count: u64§network_reconnect_count: u64§network_tick_latencies_ms: Vec<u64>§network_fill_latencies_ms: Vec<u64>§network_order_sync_latencies_ms: Vec<u64>§network_tick_in_timestamps_ms: Vec<u64>§network_tick_drop_timestamps_ms: Vec<u64>§network_reconnect_timestamps_ms: Vec<u64>§network_disconnect_timestamps_ms: Vec<u64>§network_last_fill_ms: Option<u64>§network_pending_submit_ms_by_intent: HashMap<String, u64>§history_rows: Vec<String>§history_bucket: HistoryBucket§last_applied_fee: String§grid_open: bool§ui_projection: UiProjection§rate_budget_global: RateBudgetSnapshot§rate_budget_orders: RateBudgetSnapshot§rate_budget_account: RateBudgetSnapshot§rate_budget_market_data: RateBudgetSnapshot§close_all_running: bool§close_all_job_id: Option<u64>§close_all_total: usize§close_all_completed: usize§close_all_failed: usize§close_all_current_symbol: Option<String>§close_all_status_expire_at_ms: Option<u64>§close_all_row_status_by_symbol: HashMap<String, String>§hide_small_positions: bool§hide_empty_predictor_rows: bool§predictor_scroll_offset: usizeImplementations§
Source§impl AppState
impl AppState
pub fn new( symbol: &str, strategy_label: &str, price_history_len: usize, candle_interval_ms: u64, timeframe: &str, ) -> Self
Sourcepub fn last_price(&self) -> Option<f64>
pub fn last_price(&self) -> Option<f64>
Get the latest price (from current candle or last finalized candle).
pub fn push_log(&mut self, msg: String)
pub fn push_log_record(&mut self, record: LogRecord)
Sourcepub fn view_state(&self) -> ViewState
pub fn view_state(&self) -> ViewState
Transitional projection for RFC-0016 Phase 2. Keeps runtime behavior unchanged while exposing normalized naming.
pub fn is_grid_open(&self) -> bool
pub fn set_grid_open(&mut self, open: bool)
pub fn grid_tab(&self) -> GridTab
pub fn set_grid_tab(&mut self, tab: GridTab)
pub fn selected_grid_symbol_index(&self) -> usize
pub fn set_selected_grid_symbol_index(&mut self, idx: usize)
pub fn selected_grid_strategy_index(&self) -> usize
pub fn set_selected_grid_strategy_index(&mut self, idx: usize)
pub fn is_on_panel_selected(&self) -> bool
pub fn set_on_panel_selected(&mut self, selected: bool)
pub fn predictor_scroll_offset(&self) -> usize
pub fn set_predictor_scroll_offset(&mut self, offset: usize)
pub fn is_symbol_selector_open(&self) -> bool
pub fn set_symbol_selector_open(&mut self, open: bool)
pub fn symbol_selector_index(&self) -> usize
pub fn set_symbol_selector_index(&mut self, idx: usize)
pub fn is_strategy_selector_open(&self) -> bool
pub fn set_strategy_selector_open(&mut self, open: bool)
pub fn strategy_selector_index(&self) -> usize
pub fn set_strategy_selector_index(&mut self, idx: usize)
pub fn is_account_popup_open(&self) -> bool
pub fn set_account_popup_open(&mut self, open: bool)
pub fn is_history_popup_open(&self) -> bool
pub fn set_history_popup_open(&mut self, open: bool)
pub fn is_focus_popup_open(&self) -> bool
pub fn set_focus_popup_open(&mut self, open: bool)
pub fn is_close_all_confirm_open(&self) -> bool
pub fn set_close_all_confirm_open(&mut self, open: bool)
pub fn is_close_all_running(&self) -> bool
pub fn close_all_status_text(&self) -> Option<String>
pub fn is_strategy_editor_open(&self) -> bool
pub fn set_strategy_editor_open(&mut self, open: bool)
pub fn focus_symbol(&self) -> Option<&str>
pub fn focus_strategy_id(&self) -> Option<&str>
pub fn set_focus_symbol(&mut self, symbol: Option<String>)
pub fn set_focus_strategy_id(&mut self, strategy_id: Option<String>)
pub fn focus_pair(&self) -> (Option<String>, Option<String>)
pub fn assets_view(&self) -> &[AssetEntry]
pub fn refresh_history_rows(&mut self)
pub fn apply(&mut self, event: AppEvent)
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe for AppState
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more