pub struct ArgumentSpec {Show 14 fields
pub name: String,
pub long: Option<String>,
pub short: Option<char>,
pub positional: bool,
pub takes_value: bool,
pub required: bool,
pub variadic: bool,
pub global: bool,
pub help: String,
pub value_name: Option<String>,
pub values: Vec<ValueChoice>,
pub defaults: Vec<String>,
pub source: ValueSource,
pub secrecy: Secrecy,
}Expand description
One argument of a command, as the declaration gives it plus what can be inferred.
Fields§
§name: StringThe argument’s id.
long: Option<String>--long, without the dashes.
short: Option<char>-s, without the dash.
positional: boolGiven by position rather than by flag.
takes_value: boolTakes a value at all; a flag does not.
required: boolMust be given.
variadic: boolTakes any number of values.
global: boolAccepted by every command under the one that declares it.
help: StringThe help text, one line.
value_name: Option<String>The placeholder, PATH.
values: Vec<ValueChoice>The values the declaration carries, each with its help.
defaults: Vec<String>The defaults, as the declaration renders them.
source: ValueSourceWhere further values come from.
secrecy: SecrecyHow openly the value may be handled.
Trait Implementations§
Source§impl Clone for ArgumentSpec
impl Clone for ArgumentSpec
Source§fn clone(&self) -> ArgumentSpec
fn clone(&self) -> ArgumentSpec
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 ArgumentSpec
impl Debug for ArgumentSpec
Source§impl<'de> Deserialize<'de> for ArgumentSpec
impl<'de> Deserialize<'de> for ArgumentSpec
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
impl Eq for ArgumentSpec
Source§impl JsonSchema for ArgumentSpec
impl JsonSchema for ArgumentSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ArgumentSpec
impl PartialEq for ArgumentSpec
Source§fn eq(&self, other: &ArgumentSpec) -> bool
fn eq(&self, other: &ArgumentSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ArgumentSpec
impl Serialize for ArgumentSpec
impl StructuralPartialEq for ArgumentSpec
Auto Trait Implementations§
impl Freeze for ArgumentSpec
impl RefUnwindSafe for ArgumentSpec
impl Send for ArgumentSpec
impl Sync for ArgumentSpec
impl Unpin for ArgumentSpec
impl UnsafeUnpin for ArgumentSpec
impl UnwindSafe for ArgumentSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.