Struct ParsedArg

struct ParsedArg<'s> { ... }

Command-line Argument

Implementations

impl<'s> ParsedArg<'s>

fn is_empty(self: &Self) -> bool

Argument is length of 0

fn is_stdio(self: &Self) -> bool

Does the argument look like a stdio argument (-)

fn is_escape(self: &Self) -> bool

Does the argument look like an argument escape (--)

fn is_negative_number(self: &Self) -> bool

Does the argument look like a negative number?

This won't parse the number in full but attempts to see if this looks like something along the lines of -3, -0.3, or -33.03

fn to_long(self: &Self) -> Option<(Result<&str, &OsStr>, Option<&OsStr>)>

Treat as a long-flag

fn is_long(self: &Self) -> bool

Can treat as a long-flag

fn to_short(self: &Self) -> Option<ShortFlags<'_>>

Treat as a short-flag

fn is_short(self: &Self) -> bool

Can treat as a short-flag

fn to_value_os(self: &Self) -> &OsStr

Treat as a value

NOTE: May return a flag or an escape.

fn to_value(self: &Self) -> Result<&str, &OsStr>

Treat as a value

NOTE: May return a flag or an escape.

fn display(self: &Self) -> impl Display + '_

Safely print an argument that may contain non-UTF8 content

This may perform lossy conversion, depending on the platform. If you would like an implementation which escapes the path please use Debug instead.

impl<'s> Clone for ParsedArg<'s>

fn clone(self: &Self) -> ParsedArg<'s>

impl<'s> Debug for ParsedArg<'s>

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

impl<'s> Eq for ParsedArg<'s>

impl<'s> Freeze for ParsedArg<'s>

impl<'s> Hash for ParsedArg<'s>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<'s> Ord for ParsedArg<'s>

fn cmp(self: &Self, other: &ParsedArg<'s>) -> Ordering

impl<'s> PartialEq for ParsedArg<'s>

fn eq(self: &Self, other: &ParsedArg<'s>) -> bool

impl<'s> PartialOrd for ParsedArg<'s>

fn partial_cmp(self: &Self, other: &ParsedArg<'s>) -> Option<Ordering>

impl<'s> RefUnwindSafe for ParsedArg<'s>

impl<'s> Send for ParsedArg<'s>

impl<'s> StructuralPartialEq for ParsedArg<'s>

impl<'s> Sync for ParsedArg<'s>

impl<'s> Unpin for ParsedArg<'s>

impl<'s> UnsafeUnpin for ParsedArg<'s>

impl<'s> UnwindSafe for ParsedArg<'s>

impl<T> Any for ParsedArg<'s>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for ParsedArg<'s>

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

impl<T> BorrowMut for ParsedArg<'s>

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

impl<T> CloneToUninit for ParsedArg<'s>

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

impl<T> From for ParsedArg<'s>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for ParsedArg<'s>

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

impl<T, U> Into for ParsedArg<'s>

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 ParsedArg<'s>

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

impl<T, U> TryInto for ParsedArg<'s>

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