pub struct ParamInfo {
pub name: &'static str,
pub default: ParamDefault,
pub unit: &'static str,
pub choices: &'static [&'static str],
pub gt: Option<f64>,
pub ge: Option<f64>,
pub le: Option<f64>,
pub lt: Option<f64>,
pub doc: &'static str,
pub schema: Value,
pub variants: Vec<(&'static str, Vec<ParamInfo>)>,
pub fields: Vec<ParamInfo>,
}Expand description
One parameter of a block.
Fields§
§name: &'static strName.
default: ParamDefaultDefault.
unit: &'static strUnit (dB, Hz, ps/nm/km…; empty for a number without unit or a non-number).
choices: &'static [&'static str]The accepted values of a string (empty: any value of the type).
gt: Option<f64>Exclusive lower bound of a number.
ge: Option<f64>Inclusive lower bound of a number.
le: Option<f64>Inclusive upper bound of a number.
lt: Option<f64>Exclusive upper bound of a number.
doc: &'static strMeaning.
schema: ValueThe JSON Schema of the type of the value ({"type": "number"}…).
variants: Vec<(&'static str, Vec<ParamInfo>)>The mappings the value may be, by their type, each with its parameters (the
codes of fec_encode, see ParamType::variants); empty for any other value.
fields: Vec<ParamInfo>The keys of a value that is a mapping of parameters (Mapping, NameOr,
see ParamType::fields); empty for any other value.
Implementations§
Source§impl ParamInfo
impl ParamInfo
Sourcepub fn describe(&self, indent: usize) -> String
pub fn describe(&self, indent: usize) -> String
The parameter as one line of text (name, default, meaning, unit, accepted values, bounds), then one line per key of its mapping and per parameter of every variant of its value, indented.
Sourcepub fn default_text(&self) -> String
pub fn default_text(&self) -> String
The default as text: required, the value, or what an absent value means.
Sourcepub fn json_schema(&self) -> Json
pub fn json_schema(&self) -> Json
The JSON Schema of the parameter: its type, unit, accepted values, bounds,
default and meaning (a string $name of a grid variable is accepted too).
Trait Implementations§
Auto Trait Implementations§
impl Forget for ParamInfo
impl Freeze for ParamInfo
impl RefUnwindSafe for ParamInfo
impl Send for ParamInfo
impl Sync for ParamInfo
impl Unpin for ParamInfo
impl UnsafeUnpin for ParamInfo
impl UnwindSafe for ParamInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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