ARG_OUTPUT

Struct ARG_OUTPUT 

Source
pub struct ARG_OUTPUT { /* private fields */ }

Methods from Deref<Target = Arg>§

Source

pub fn get_id(&self) -> &Id

Get the name of the argument

Source

pub fn get_help(&self) -> Option<&StyledStr>

Get the help specified for this argument, if any

Source

pub fn get_long_help(&self) -> Option<&StyledStr>

Get the long help specified for this argument, if any

§Examples
let arg = Arg::new("foo").long_help("long help");
assert_eq!(Some("long help".to_owned()), arg.get_long_help().map(|s| s.to_string()));
Source

pub fn get_display_order(&self) -> usize

Get the placement within help

Source

pub fn get_help_heading(&self) -> Option<&str>

Get the help heading specified for this argument, if any

Source

pub fn get_short(&self) -> Option<char>

Get the short option name for this argument, if any

Source

pub fn get_visible_short_aliases(&self) -> Option<Vec<char>>

Get visible short aliases for this argument, if any

Source

pub fn get_all_short_aliases(&self) -> Option<Vec<char>>

Get all short aliases for this argument, if any, both visible and hidden.

Source

pub fn get_short_and_visible_aliases(&self) -> Option<Vec<char>>

Get the short option name and its visible aliases, if any

Source

pub fn get_long(&self) -> Option<&str>

Get the long option name for this argument, if any

Source

pub fn get_visible_aliases(&self) -> Option<Vec<&str>>

Get visible aliases for this argument, if any

Source

pub fn get_all_aliases(&self) -> Option<Vec<&str>>

Get all aliases for this argument, if any, both visible and hidden.

Source

pub fn get_long_and_visible_aliases(&self) -> Option<Vec<&str>>

Get the long option name and its visible aliases, if any

Source

pub fn get_aliases(&self) -> Option<Vec<&str>>

Get hidden aliases for this argument, if any

Source

pub fn get_possible_values(&self) -> Vec<PossibleValue>

Get the names of possible values for this argument. Only useful for user facing applications, such as building help messages or man files

Source

pub fn get_value_names(&self) -> Option<&[Str]>

Get the names of values for this argument.

Source

pub fn get_num_args(&self) -> Option<ValueRange>

Get the number of values for this argument.

Source

pub fn get_value_delimiter(&self) -> Option<char>

Get the delimiter between multiple values

Source

pub fn get_value_terminator(&self) -> Option<&Str>

Get the value terminator for this argument. The value_terminator is a value that terminates parsing of multi-valued arguments.

Source

pub fn get_index(&self) -> Option<usize>

Get the index of this argument, if any

Source

pub fn get_value_hint(&self) -> ValueHint

Get the value hint of this argument

Source

pub fn get_default_values(&self) -> &[OsStr]

Get the default values specified for this argument, if any

§Examples
let arg = Arg::new("foo").default_value("default value");
assert_eq!(arg.get_default_values(), &["default value"]);
Source

pub fn is_positional(&self) -> bool

Checks whether this argument is a positional or not.

§Examples
let arg = Arg::new("foo");
assert_eq!(arg.is_positional(), true);

let arg = Arg::new("foo").long("foo");
assert_eq!(arg.is_positional(), false);
Source

pub fn is_required_set(&self) -> bool

Reports whether Arg::required is set

Source

pub fn is_allow_hyphen_values_set(&self) -> bool

Report whether Arg::allow_hyphen_values is set

Source

pub fn is_allow_negative_numbers_set(&self) -> bool

Report whether Arg::allow_negative_numbers is set

Source

pub fn get_action(&self) -> &ArgAction

Behavior when parsing the argument

Source

pub fn get_value_parser(&self) -> &ValueParser

Configured parser for argument values

§Example
let cmd = clap::Command::new("raw")
    .arg(
        clap::Arg::new("port")
            .value_parser(clap::value_parser!(usize))
    );
let value_parser = cmd.get_arguments()
    .find(|a| a.get_id() == "port").unwrap()
    .get_value_parser();
println!("{value_parser:?}");
Source

pub fn is_global_set(&self) -> bool

Report whether Arg::global is set

Source

pub fn is_next_line_help_set(&self) -> bool

Report whether Arg::next_line_help is set

Source

pub fn is_hide_set(&self) -> bool

Report whether Arg::hide is set

Source

pub fn is_hide_default_value_set(&self) -> bool

Report whether Arg::hide_default_value is set

Source

pub fn is_hide_possible_values_set(&self) -> bool

Report whether Arg::hide_possible_values is set

Source

pub fn is_hide_short_help_set(&self) -> bool

Report whether Arg::hide_short_help is set

Source

pub fn is_hide_long_help_set(&self) -> bool

Report whether Arg::hide_long_help is set

Source

pub fn is_require_equals_set(&self) -> bool

Report whether Arg::require_equals is set

Source

pub fn is_exclusive_set(&self) -> bool

Reports whether Arg::exclusive is set

Source

pub fn is_trailing_var_arg_set(&self) -> bool

Report whether Arg::trailing_var_arg is set

Source

pub fn is_last_set(&self) -> bool

Reports whether Arg::last is set

Source

pub fn is_ignore_case_set(&self) -> bool

Reports whether Arg::ignore_case is set

Trait Implementations§

Source§

impl Deref for ARG_OUTPUT

Source§

type Target = Arg

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Arg

Dereferences the value.
Source§

impl LazyStatic for ARG_OUTPUT

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.