pub enum OptionKind {
Number {
default: Option<f64>,
min: Option<f64>,
max: Option<f64>,
},
Integer {
default: Option<i64>,
min: Option<i64>,
max: Option<i64>,
},
Boolean {
default: Option<bool>,
},
Text {
default: Option<String>,
},
NumberList {
default: Option<Vec<f64>>,
min_len: Option<usize>,
ascending: bool,
},
Choice {
default: Option<String>,
items: Vec<ChoiceItem>,
},
MultiChoice {
default: Option<Vec<String>>,
items: Vec<ChoiceItem>,
},
}Expand description
Shape and bounds of one describable block option (spec §3.2.1).
Bounds and defaults are advisory — they tell a UI what to offer, and are never the validation authority. Production validates independently, so an engine may accept a value no descriptor advertised.
Variants§
Number
Real number, with optional inclusive bounds.
Integer
Whole number, with optional inclusive bounds.
Boolean
Text
NumberList
Ordered list of reals — threshold edges and the like.
Fields
Choice
Exactly one of items.
MultiChoice
Any subset of items.
Trait Implementations§
Source§impl Clone for OptionKind
impl Clone for OptionKind
Source§fn clone(&self) -> OptionKind
fn clone(&self) -> OptionKind
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 OptionKind
impl Debug for OptionKind
Source§impl<'de> Deserialize<'de> for OptionKind
impl<'de> Deserialize<'de> for OptionKind
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 OptionKind
impl PartialEq for OptionKind
Source§impl Serialize for OptionKind
impl Serialize for OptionKind
impl StructuralPartialEq for OptionKind
Auto Trait Implementations§
impl Freeze for OptionKind
impl RefUnwindSafe for OptionKind
impl Send for OptionKind
impl Sync for OptionKind
impl Unpin for OptionKind
impl UnsafeUnpin for OptionKind
impl UnwindSafe for OptionKind
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