Skip to main content

ChartSnapshot

Struct ChartSnapshot 

Source
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: String

The symbol shown.

§interval: Option<Timeframe>

The interval shown, None for a chart without one.

§extended_hours: bool

Whether extended hours are requested.

§chart_type: ChartType

The chart type.

§chart_type_params: ChartTypeParams

The parameters of the price-based chart types and of the baseline.

§main_series_visible: bool

Whether the main series is drawn.

§main_series_alerts: SeriesAlerts

Visibility 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: ChartSettingsState

The 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: f32

The space between bars in points.

§right_offset: f32

The 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

Source§

fn clone(&self) -> ChartSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChartSnapshot

Source§

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

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

impl<'de> Deserialize<'de> for ChartSnapshot

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ChartSnapshot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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
§

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

§

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

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

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

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.