pub struct Args { /* private fields */ }Expand description
The arguments after the verb.
Implementations§
Source§impl Args
impl Args
pub fn new(items: impl IntoIterator<Item = impl Into<String>>) -> Self
Sourcepub fn value(&mut self, name: &str) -> Result<Option<String>, String>
pub fn value(&mut self, name: &str) -> Result<Option<String>, String>
Take --name VALUE or --name=VALUE.
Sourcepub fn number<T: FromStr>(&mut self, name: &str) -> Result<Option<T>, String>
pub fn number<T: FromStr>(&mut self, name: &str) -> Result<Option<T>, String>
Take --name N as a number.
Sourcepub fn positional(&mut self) -> Option<String>
pub fn positional(&mut self) -> Option<String>
Take the next positional (- counts as one: stdin). Take options first, so an option’s
value is not mistaken for a positional.
Trait Implementations§
impl StructuralPartialEq for Args
Auto Trait Implementations§
impl Freeze for Args
impl RefUnwindSafe for Args
impl Send for Args
impl Sync for Args
impl Unpin for Args
impl UnsafeUnpin for Args
impl UnwindSafe for Args
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