pub struct ArgumentTraverser<'cmd> { /* private fields */ }
Expand description
Iterates over the individual arguments in a command accounting for quoted arguments.
Implementations§
Source§impl<'cmd> ArgumentTraverser<'cmd>
impl<'cmd> ArgumentTraverser<'cmd>
Sourcepub fn new(command: &'cmd str) -> Self
pub fn new(command: &'cmd str) -> Self
Creates a traverser over the given command, stripping off the initial ‘/’ if it exists.
Sourcepub fn gobble_remaining(&mut self) -> &'cmd str
pub fn gobble_remaining(&mut self) -> &'cmd str
Returns the remaining portion of the string being traversed, including the argument which was last read.
Sourcepub fn gobble_remaining_truncated(&self, truncate_to: usize) -> &'cmd str
pub fn gobble_remaining_truncated(&self, truncate_to: usize) -> &'cmd str
Returns the remaining portion of the string being traversed from the current anchor position to the end of the string.
Auto Trait Implementations§
impl<'cmd> Freeze for ArgumentTraverser<'cmd>
impl<'cmd> RefUnwindSafe for ArgumentTraverser<'cmd>
impl<'cmd> Send for ArgumentTraverser<'cmd>
impl<'cmd> Sync for ArgumentTraverser<'cmd>
impl<'cmd> Unpin for ArgumentTraverser<'cmd>
impl<'cmd> UnwindSafe for ArgumentTraverser<'cmd>
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