pub struct Args<'a> { /* private fields */ }Expand description
A command’s arguments, the words typed after its name, checked against its usage: each word the usage names typed as it is, each choice one of the choices, as the usage spells it, each required argument there, and no more than the usage has.
Implementations§
Source§impl<'a> Args<'a>
impl<'a> Args<'a>
Sourcepub fn get(&self, index: usize) -> Option<&'a str>
pub fn get(&self, index: usize) -> Option<&'a str>
The argument at index, from 0, if it was typed.
Sourcepub fn f32(&self, index: usize) -> Result<f32, ConsoleError>
pub fn f32(&self, index: usize) -> Result<f32, ConsoleError>
The argument at index as a number, which must be finite.
§Errors
ConsoleError::MissingArgument if it was not typed, and
ConsoleError::InvalidArgument if it is no finite number.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Args<'a>
impl<'a> Freeze for Args<'a>
impl<'a> Move for Args<'a>
impl<'a> RefUnwindSafe for Args<'a>
impl<'a> Send for Args<'a>
impl<'a> Sync for Args<'a>
impl<'a> Unpin for Args<'a>
impl<'a> UnsafeUnpin for Args<'a>
impl<'a> UnwindSafe for Args<'a>
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