pub struct ArgBinding {
pub long: Option<String>,
pub short: Option<String>,
pub arity: u8,
pub value_name: Option<String>,
pub negatable: bool,
pub repeatable: bool,
pub position: Option<u16>,
}Expand description
How a value may arrive from the argument vector.
Fields§
§long: Option<String>The long form, without dashes.
short: Option<String>The short form, without its dash.
arity: u8How many values the flag consumes: 0 for a boolean whose presence is
the value, 1 otherwise.
Derived from the type by the emitter and written out explicitly, so no consumer in any language has to re-derive it — and so a generated parser can never disagree with the one that published the contract.
value_name: Option<String>The placeholder shown in help for the value.
negatable: boolWhether --no-<long> is accepted.
repeatable: boolWhether the flag may be repeated, accumulating values.
position: Option<u16>A bare positional slot instead of a named flag — see
crate::Arg::positional. Mutually exclusive with long/short.
Trait Implementations§
Source§impl Clone for ArgBinding
impl Clone for ArgBinding
Source§fn clone(&self) -> ArgBinding
fn clone(&self) -> ArgBinding
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 ArgBinding
impl Debug for ArgBinding
Source§impl<'de> Deserialize<'de> for ArgBinding
impl<'de> Deserialize<'de> for ArgBinding
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArgBinding, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArgBinding, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ArgBinding
impl PartialEq for ArgBinding
Source§impl Serialize for ArgBinding
impl Serialize for ArgBinding
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ArgBinding
Auto Trait Implementations§
impl Forget for ArgBinding
impl Freeze for ArgBinding
impl Move for ArgBinding
impl RefUnwindSafe for ArgBinding
impl Send for ArgBinding
impl Sync for ArgBinding
impl Unpin for ArgBinding
impl UnsafeUnpin for ArgBinding
impl UnwindSafe for ArgBinding
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