Skip to main content

ChartAppState

Trait ChartAppState 

Source
pub trait ChartAppState {
    // Required methods
    fn active_symbol(&self) -> &str;
    fn active_timeframe(&self) -> &Timeframe;
    fn chart_type(&self) -> ChartType;
    fn is_connected(&self) -> bool;
    fn is_replay_active(&self) -> bool;
}
Expand description

Trait for application state that chart UI components can read from.

Library consumers implement this on their app state type to connect the UI components to their data layer.

Required Methods§

Source

fn active_symbol(&self) -> &str

Currently active trading symbol (e.g., “AAPL”, “BTC/USD”).

Source

fn active_timeframe(&self) -> &Timeframe

Current chart timeframe.

Source

fn chart_type(&self) -> ChartType

Current chart visualization type.

Source

fn is_connected(&self) -> bool

Whether the data connection is active.

Source

fn is_replay_active(&self) -> bool

Whether replay mode is active.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§