Struct RawValues

struct RawValues<'a> { ... }

Iterate over raw argument values via ArgMatches::get_raw.

Examples

# #[cfg(unix)] {
# use clap_builder as clap;
# use clap::{Command, arg, value_parser};
use std::ffi::OsString;
use std::os::unix::ffi::{OsStrExt,OsStringExt};

let m = Command::new("utf8")
    .arg(arg!(<arg> "some arg")
        .value_parser(value_parser!(OsString)))
    .get_matches_from(vec![OsString::from("myprog"),
                            // "Hi {0xe9}!"
                            OsString::from_vec(vec![b'H', b'i', b' ', 0xe9, b'!'])]);
assert_eq!(
    &*m.get_raw("arg")
        .unwrap()
        .next().unwrap()
        .as_bytes(),
    [b'H', b'i', b' ', 0xe9, b'!']
);
# }

Implementations

impl Default for RawValues<'_>

fn default() -> Self

impl ExactSizeIterator for RawValues<'_>

impl<'a> Clone for RawValues<'a>

fn clone(self: &Self) -> RawValues<'a>

impl<'a> Debug for RawValues<'a>

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

impl<'a> DoubleEndedIterator for RawValues<'a>

fn next_back(self: &mut Self) -> Option<&'a OsStr>

impl<'a> Freeze for RawValues<'a>

impl<'a> Iterator for RawValues<'a>

fn next(self: &mut Self) -> Option<&'a OsStr>
fn size_hint(self: &Self) -> (usize, Option<usize>)

impl<'a> RefUnwindSafe for RawValues<'a>

impl<'a> Send for RawValues<'a>

impl<'a> Sync for RawValues<'a>

impl<'a> Unpin for RawValues<'a>

impl<'a> UnsafeUnpin for RawValues<'a>

impl<'a> UnwindSafe for RawValues<'a>

impl<I> IntoIterator for RawValues<'a>

fn into_iter(self: Self) -> I

impl<T> Any for RawValues<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for RawValues<'a>

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

impl<T> BorrowMut for RawValues<'a>

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

impl<T> CloneToUninit for RawValues<'a>

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

impl<T> From for RawValues<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for RawValues<'a>

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

impl<T, U> Into for RawValues<'a>

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 RawValues<'a>

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

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

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