pub struct ChartSnapshot {Show 21 fields
pub symbol: String,
pub interval: Option<Timeframe>,
pub extended_hours: bool,
pub chart_type: ChartType,
pub chart_type_params: ChartTypeParams,
pub main_series_visible: bool,
pub main_series_alerts: SeriesAlerts,
pub main_series_display_format: Option<SeriesDisplayFormat>,
pub settings: ChartSettingsState,
pub config: Option<ChartConfig>,
pub palette: Option<ChartConfig>,
pub options: Option<ChartOptions>,
pub price_scale: Option<PriceScale>,
pub maximized: Option<usize>,
pub studies: Vec<SavedStudy>,
pub series: Option<Vec<SavedSeries>>,
pub main_annotations: Option<SavedAnnotations>,
pub panes: Vec<SavedPane>,
pub bar_spacing: f32,
pub right_offset: f32,
pub drawings: Option<Value>,
}Expand description
What a chart shows and how: everything a user sets on it, without the bars, which come from
the host’s feed. Take one with Chart::snapshot and apply it with Chart::restore.
The trading and alert settings of the settings dialog belong to the host and are not part
of it.
Fields§
§symbol: StringThe symbol shown.
interval: Option<Timeframe>The interval shown, None for a chart without one.
extended_hours: boolWhether extended hours are requested.
chart_type: ChartTypeThe chart type.
chart_type_params: ChartTypeParamsThe parameters of the price-based chart types and of the baseline.
main_series_visible: boolWhether the main series is drawn.
main_series_alerts: SeriesAlertsVisibility and style of the main series’ alert levels; absent in older layouts.
main_series_display_format: Option<SeriesDisplayFormat>Raw numeric display settings of the main series; absent in older layouts.
settings: ChartSettingsStateThe display settings of the settings dialog, the price scale’s mode and margins included.
config: Option<ChartConfig>Complete appearance settings; absent in version 1 layouts.
palette: Option<ChartConfig>The palette config’s colours followed, so that Chart::restore can tell the colours
the user edited from those that follow the active theme; absent in older layouts.
options: Option<ChartOptions>Interaction and time axis settings; absent in version 1 layouts.
price_scale: Option<PriceScale>The main price scale, including its manual range and transform.
maximized: Option<usize>Position of the maximized pane, or no maximized pane.
studies: Vec<SavedStudy>The studies in the order they were added, including the volume study.
series: Option<Vec<SavedSeries>>The bar series added to the chart in draw order, None in layouts saved before version
3, which leave the chart’s added series in place.
main_annotations: Option<SavedAnnotations>The markers and price lines of the main series, None in layouts saved before version 3.
panes: Vec<SavedPane>The panes from top to bottom, including preserved empty panes.
bar_spacing: f32The space between bars in points.
right_offset: f32The space after the last bar, in bars.
drawings: Option<Value>The symbol’s drawings as a drawings document (see DrawingStorage::to_json).
Version 1 layouts may omit drawings kept in per-symbol storage.
Trait Implementations§
Source§impl Clone for ChartSnapshot
impl Clone for ChartSnapshot
Source§fn clone(&self) -> ChartSnapshot
fn clone(&self) -> ChartSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChartSnapshot
impl Debug for ChartSnapshot
Source§impl<'de> Deserialize<'de> for ChartSnapshot
impl<'de> Deserialize<'de> for ChartSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !RefUnwindSafe for ChartSnapshot
impl !UnwindSafe for ChartSnapshot
impl Freeze for ChartSnapshot
impl Send for ChartSnapshot
impl Sync for ChartSnapshot
impl Unpin for ChartSnapshot
impl UnsafeUnpin for ChartSnapshot
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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