pub struct OptionSpec {
pub def: OptionDef,
pub required: bool,
pub default: Option<String>,
pub value_completion: Option<ValueProvider>,
}Expand description
One option as it appears on a specific command: the shared OptionDef
shape plus this command’s required-ness, default, and value completer.
Fields§
§def: OptionDefThe shared, parse-defining shape (flag, short, arity, value name, help).
required: boolWhether this command requires the option. May differ per command.
default: Option<String>Default value applied when the option is absent (value options only).
value_completion: Option<ValueProvider>Per-command value completer (closed set, path, dynamic). The completion
bridge attaches it to this command’s node. It is not part of the parse
shape or the consistency audit, so it may legitimately differ between
commands that share the same def.
Implementations§
Trait Implementations§
Source§impl Clone for OptionSpec
impl Clone for OptionSpec
Source§fn clone(&self) -> OptionSpec
fn clone(&self) -> OptionSpec
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for OptionSpec
impl !UnwindSafe for OptionSpec
impl Freeze for OptionSpec
impl Send for OptionSpec
impl Sync for OptionSpec
impl Unpin for OptionSpec
impl UnsafeUnpin 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