pub struct ParamSpec {
pub name: &'static str,
pub kind: ParamKind,
pub default: f64,
pub min: f64,
pub max: f64,
}Expand description
A single tunable parameter of an indicator.
default, min and max are all f64 regardless of ParamKind so the
serialized JSON has a uniform numeric shape; for Integer params the values
are whole numbers stored as f64 (e.g. 14.0).
Fields§
§name: &'static strParameter key — matches the key the indicator’s factory() reads
(e.g. "period", "fast_period", "std_dev").
kind: ParamKindWhether the UI should treat this as an integer or a float control.
default: f64Default value — must equal the factory’s default and lie in [min, max].
min: f64Inclusive lower bound for the UI control.
max: f64Inclusive upper bound for the UI control.
Implementations§
Trait Implementations§
impl Copy for ParamSpec
Source§impl Deserialize<'static> for ParamSpec
impl Deserialize<'static> for ParamSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ParamSpec
Auto Trait Implementations§
impl Freeze for ParamSpec
impl RefUnwindSafe for ParamSpec
impl Send for ParamSpec
impl Sync for ParamSpec
impl Unpin for ParamSpec
impl UnsafeUnpin for ParamSpec
impl UnwindSafe for ParamSpec
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