pub struct StudyTemplate {
pub name: String,
pub inputs: Vec<(String, InputValue)>,
pub settings: StudySettings,
pub visible: bool,
pub scale: Option<StudyScale>,
}Expand description
Serializable inputs and presentation of one study. Hosts may resolve name through their
own study factory when they supply custom studies.
Fields§
§name: StringStudy factory name.
inputs: Vec<(String, InputValue)>Typed inputs keyed by their stable study-local identifiers.
settings: StudySettingsPlot styles, precision and interval visibility.
visible: boolWhether the study is visible.
scale: Option<StudyScale>The value scale, or None to keep the study’s own, as templates saved before the scale
was kept do.
Implementations§
Source§impl StudyTemplate
impl StudyTemplate
Sourcepub fn from_study(study: &dyn Indicator) -> Self
pub fn from_study(study: &dyn Indicator) -> Self
Capture the current calculation inputs, presentation and value scale, without computed
values. An input that reads another study’s plot keeps that study’s chart id;
Chart::study_template_set saves a chart’s studies with the links between them.
Sourcepub fn create(&self) -> Result<Box<dyn Indicator>, StudyError>
pub fn create(&self) -> Result<Box<dyn Indicator>, StudyError>
Reconstruct a built-in study. Unknown names or invalid inputs leave the host chart intact. Hosts reconstruct the entire set successfully before replacing their current studies.
Sourcepub fn create_with(
&self,
factory: &IndicatorFactory,
) -> Result<Box<dyn Indicator>, StudyError>
pub fn create_with( &self, factory: &IndicatorFactory, ) -> Result<Box<dyn Indicator>, StudyError>
Trait Implementations§
Source§impl Clone for StudyTemplate
impl Clone for StudyTemplate
Source§fn clone(&self) -> StudyTemplate
fn clone(&self) -> StudyTemplate
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 StudyTemplate
impl Debug for StudyTemplate
Source§impl<'de> Deserialize<'de> for StudyTemplate
impl<'de> Deserialize<'de> for StudyTemplate
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 Freeze for StudyTemplate
impl RefUnwindSafe for StudyTemplate
impl Send for StudyTemplate
impl Sync for StudyTemplate
impl Unpin for StudyTemplate
impl UnsafeUnpin for StudyTemplate
impl UnwindSafe for StudyTemplate
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