pub struct ParsedArg<'s> { /* private fields */ }Expand description
Command-line Argument
Implementations§
source§impl<'s> ParsedArg<'s>
impl<'s> ParsedArg<'s>
sourcepub fn is_negative_number(&self) -> bool
pub fn is_negative_number(&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
sourcepub fn to_short(&self) -> Option<ShortFlags<'_>>
pub fn to_short(&self) -> Option<ShortFlags<'_>>
Treat as a short-flag
sourcepub fn to_value_os(&self) -> &OsStr
pub fn to_value_os(&self) -> &OsStr
Treat as a value
NOTE: May return a flag or an escape.
Trait Implementations§
source§impl<'s> Ord for ParsedArg<'s>
impl<'s> Ord for ParsedArg<'s>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'s> PartialEq for ParsedArg<'s>
impl<'s> PartialEq for ParsedArg<'s>
source§impl<'s> PartialOrd for ParsedArg<'s>
impl<'s> PartialOrd for ParsedArg<'s>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<'s> Eq for ParsedArg<'s>
impl<'s> StructuralPartialEq for ParsedArg<'s>
Auto Trait Implementations§
impl<'s> Freeze for ParsedArg<'s>
impl<'s> RefUnwindSafe for ParsedArg<'s>
impl<'s> Send for ParsedArg<'s>
impl<'s> Sync for ParsedArg<'s>
impl<'s> Unpin for ParsedArg<'s>
impl<'s> UnwindSafe for ParsedArg<'s>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes