pub struct OptionDefinition {
pub name: String,
pub short: Option<String>,
pub long: Option<String>,
pub option_type: ArgumentType,
pub required: bool,
pub default: Option<String>,
pub description: String,
pub choices: Vec<String>,
}Expand description
Definition of a named option (flag)
Options are optional (by default) and can be specified
with short (-o) or long (--option) forms.
§Example
name: output
short: o
long: output
option_type: path
required: false
default: "output.txt"
description: "Output file path"
choices: []Fields§
§name: StringOption name (internal identifier)
short: Option<String>Short form (single character, e.g., “o” for -o)
long: Option<String>Long form (e.g., “output” for –output)
option_type: ArgumentTypeExpected type of the option value
required: boolWhether this option is mandatory
default: Option<String>Default value if not specified
description: StringHuman-readable description
choices: Vec<String>Restricted set of allowed values
If non-empty, the value must be one of these choices.
Trait Implementations§
Source§impl Clone for OptionDefinition
impl Clone for OptionDefinition
Source§fn clone(&self) -> OptionDefinition
fn clone(&self) -> OptionDefinition
Returns a duplicate of the value. Read more
1.0.0 · 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 OptionDefinition
impl Debug for OptionDefinition
Source§impl<'de> Deserialize<'de> for OptionDefinition
impl<'de> Deserialize<'de> for OptionDefinition
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 OptionDefinition
impl PartialEq for OptionDefinition
Source§impl Serialize for OptionDefinition
impl Serialize for OptionDefinition
impl StructuralPartialEq for OptionDefinition
Auto Trait Implementations§
impl Freeze for OptionDefinition
impl RefUnwindSafe for OptionDefinition
impl Send for OptionDefinition
impl Sync for OptionDefinition
impl Unpin for OptionDefinition
impl UnwindSafe for OptionDefinition
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