pub enum OptionSpec {
Toggle {
id: &'static str,
label: &'static str,
default: bool,
},
Choice {
id: &'static str,
label: &'static str,
choices: &'static [(&'static str, &'static str)],
default: &'static str,
},
Number {
id: &'static str,
label: &'static str,
min: i64,
max: i64,
default: i64,
},
Group {
label: &'static str,
pane: OptionPane,
},
Text {
id: &'static str,
label: &'static str,
placeholder: &'static str,
default: &'static str,
},
}Variants§
Toggle
Choice
A one-of-N picker. Choices are (value, label) pairs.
Fields
Number
Group
Marks where the options that follow belong. Carries no value of its own; it exists so a tool with many knobs can say which of them decide the answer and which decide how it is presented.
Options declared before any group default to OptionPane::Input.
Text
A short free-text field, for values no picker can enumerate — a cron field, a delimiter, a format string. Rendered inline with the other options, so keep it genuinely short.
Implementations§
Trait Implementations§
Source§impl Clone for OptionSpec
impl Clone for OptionSpec
impl Copy for OptionSpec
Auto Trait Implementations§
impl Freeze for OptionSpec
impl RefUnwindSafe for OptionSpec
impl Send for OptionSpec
impl Sync for OptionSpec
impl Unpin for OptionSpec
impl UnsafeUnpin for OptionSpec
impl UnwindSafe for OptionSpec
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