Struct Values

struct Values<T> { ... }

Iterate over multiple values for an argument via ArgMatches::remove_many.

Examples

# use clap_builder as clap;
# use clap::{Command, Arg, ArgAction};
let mut m = Command::new("myapp")
    .arg(Arg::new("output")
        .short('o')
        .action(ArgAction::Append))
    .get_matches_from(vec!["myapp", "-o", "val1", "-o", "val2"]);

let mut values = m.remove_many::<String>("output")
    .unwrap();

assert_eq!(values.next(), Some(String::from("val1")));
assert_eq!(values.next(), Some(String::from("val2")));
assert_eq!(values.next(), None);

Implementations

impl<I> IntoIterator for Values<T>

fn into_iter(self: Self) -> I

impl<T> Any for Values<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Values<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Values<T>

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

impl<T> CloneToUninit for Values<T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> Default for Values<T>

fn default() -> Self

impl<T> DoubleEndedIterator for Values<T>

fn next_back(self: &mut Self) -> Option<<Self as >::Item>

impl<T> ExactSizeIterator for Values<T>

impl<T> Freeze for Values<T>

impl<T> From for Values<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Iterator for Values<T>

fn next(self: &mut Self) -> Option<<Self as >::Item>
fn size_hint(self: &Self) -> (usize, Option<usize>)

impl<T> RefUnwindSafe for Values<T>

impl<T> Send for Values<T>

impl<T> Sync for Values<T>

impl<T> ToOwned for Values<T>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> Unpin for Values<T>

impl<T> UnsafeUnpin for Values<T>

impl<T> UnwindSafe for Values<T>

impl<T, U> Into for Values<T>

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Values<T>

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

impl<T, U> TryInto for Values<T>

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

impl<T: $crate::clone::Clone> Clone for Values<T>

fn clone(self: &Self) -> Values<T>

impl<T: $crate::fmt::Debug> Debug for Values<T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result