Struct RawArgs
struct RawArgs { ... }
Command-line arguments
Implementations
impl RawArgs
fn from_args() -> SelfNOTE: The argument returned will be the current binary.
Example
# use PathBuf; let raw = from_args; let mut cursor = raw.cursor; let _bin = raw.next_os; let mut paths = raw.remaining.map.; println!;fn new<impl Into<OsString>: Into<OsString>, impl IntoIterator<Item = impl Into<OsString>>: IntoIterator<Item = impl Into<OsString>>>(iter: impl IntoIterator<Item = impl Into<OsString>>) -> SelfExample
# use PathBuf; let raw = new; let mut cursor = raw.cursor; let _bin = raw.next_os; let mut paths = raw.remaining.map.; println!;fn cursor(self: &Self) -> ArgCursorCreate a cursor for walking the arguments
Example
# use PathBuf; let raw = new; let mut cursor = raw.cursor; let _bin = raw.next_os; let mut paths = raw.remaining.map.; println!;fn next(self: &Self, cursor: &mut ArgCursor) -> Option<ParsedArg<'_>>Advance the cursor, returning the next
ParsedArgfn next_os(self: &Self, cursor: &mut ArgCursor) -> Option<&OsStr>Advance the cursor, returning a raw argument value.
fn peek(self: &Self, cursor: &ArgCursor) -> Option<ParsedArg<'_>>Return the next
ParsedArgfn peek_os(self: &Self, cursor: &ArgCursor) -> Option<&OsStr>Return a raw argument value.
fn remaining(self: &Self, cursor: &mut ArgCursor) -> impl Iterator<Item = &OsStr>Return all remaining raw arguments, advancing the cursor to the end
Example
# use PathBuf; let raw = new; let mut cursor = raw.cursor; let _bin = raw.next_os; let mut paths = raw.remaining.map.; println!;fn seek(self: &Self, cursor: &mut ArgCursor, pos: SeekFrom)Adjust the cursor's position
fn insert<impl Into<OsString>: Into<OsString>, impl IntoIterator<Item = impl Into<OsString>>: IntoIterator<Item = impl Into<OsString>>>(self: &mut Self, cursor: &ArgCursor, insert_items: impl IntoIterator<Item = impl Into<OsString>>)Inject arguments before the
RawArgs::nextfn is_end(self: &Self, cursor: &ArgCursor) -> boolAny remaining args?
impl Clone for RawArgs
fn clone(self: &Self) -> RawArgs
impl Debug for RawArgs
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for RawArgs
fn default() -> RawArgs
impl Eq for RawArgs
impl Freeze for RawArgs
impl PartialEq for RawArgs
fn eq(self: &Self, other: &RawArgs) -> bool
impl RefUnwindSafe for RawArgs
impl Send for RawArgs
impl StructuralPartialEq for RawArgs
impl Sync for RawArgs
impl Unpin for RawArgs
impl UnsafeUnpin for RawArgs
impl UnwindSafe for RawArgs
impl<I, T> From for RawArgs
fn from(val: I) -> Self
impl<T> Any for RawArgs
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for RawArgs
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for RawArgs
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for RawArgs
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for RawArgs
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for RawArgs
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for RawArgs
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for RawArgs
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for RawArgs
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>