Struct ValuesRef

struct ValuesRef<'a, T> { ... }

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

Examples

# use clap_builder as clap;
# use clap::{Command, Arg, ArgAction};
let 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.get_many::<String>("output")
    .unwrap()
    .map(|s| s.as_str());

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

Implementations

impl<'a, T> Freeze for ValuesRef<'a, T>

impl<'a, T> RefUnwindSafe for ValuesRef<'a, T>

impl<'a, T> Send for ValuesRef<'a, T>

impl<'a, T> Sync for ValuesRef<'a, T>

impl<'a, T> Unpin for ValuesRef<'a, T>

impl<'a, T> UnsafeUnpin for ValuesRef<'a, T>

impl<'a, T> UnwindSafe for ValuesRef<'a, T>

impl<'a, T: $crate::clone::Clone> Clone for ValuesRef<'a, T>

fn clone(self: &Self) -> ValuesRef<'a, T>

impl<'a, T: $crate::fmt::Debug> Debug for ValuesRef<'a, T>

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

impl<'a, T: 'a> Default for ValuesRef<'a, T>

fn default() -> Self

impl<'a, T: 'a> DoubleEndedIterator for ValuesRef<'a, T>

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

impl<'a, T: 'a> ExactSizeIterator for ValuesRef<'a, T>

impl<'a, T: 'a> Iterator for ValuesRef<'a, T>

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

impl<I> IntoIterator for ValuesRef<'a, T>

fn into_iter(self: Self) -> I

impl<T> Any for ValuesRef<'a, T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for ValuesRef<'a, T>

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

impl<T> BorrowMut for ValuesRef<'a, T>

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

impl<T> CloneToUninit for ValuesRef<'a, T>

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

impl<T> From for ValuesRef<'a, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for ValuesRef<'a, T>

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

impl<T, U> Into for ValuesRef<'a, 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 ValuesRef<'a, T>

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

impl<T, U> TryInto for ValuesRef<'a, T>

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