pub enum ParameterKind {
Boolean,
Dropdown {
choices: Vec<String>,
},
Number {
min: f32,
max: f32,
step: Option<f32>,
},
Text,
}Expand description
The type of control a ModParameter is edited with, and the data
that type needs. Serializes flat alongside id/name/help_text via
#[serde(flatten)] on ModParameter::kind, tagged by a "type"
field, e.g.:
{ "id": "Fov_Boost", "name": "FOV boost", "help_text": "...",
"type": "number", "min": 0.0, "max": 20.0, "step": 0.5 }Variants§
Boolean
A checkbox. May gate a RedirectionRule::enable_if.
Dropdown
A dropdown among choices. May gate a RedirectionRule::enable_if
(empty-string selection = off). “(None)” is not implicit, a
dropdown only has a “no selection” state if "" is itself one of
choices; otherwise every choice is non-empty and the parameter is
always “on” for gating purposes.
Number
A numeric slider between min and max, with an optional step.
Cannot gate a rule, only usable via ${param_id} interpolation.
Text
A free-text field. Cannot gate a rule, only usable via
${param_id} interpolation.
Trait Implementations§
Source§impl Clone for ParameterKind
impl Clone for ParameterKind
Source§fn clone(&self) -> ParameterKind
fn clone(&self) -> ParameterKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParameterKind
impl Debug for ParameterKind
Source§impl<'de> Deserialize<'de> for ParameterKind
impl<'de> Deserialize<'de> for ParameterKind
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ParameterKind
impl PartialEq for ParameterKind
Source§fn eq(&self, other: &ParameterKind) -> bool
fn eq(&self, other: &ParameterKind) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ParameterKind
impl Serialize for ParameterKind
impl StructuralPartialEq for ParameterKind
Auto Trait Implementations§
impl Freeze for ParameterKind
impl RefUnwindSafe for ParameterKind
impl Send for ParameterKind
impl Sync for ParameterKind
impl Unpin for ParameterKind
impl UnsafeUnpin for ParameterKind
impl UnwindSafe for ParameterKind
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