struct Args { ... }
The arguments the process was started with, the program's name first, as C's main received them. A program's entry function may take one, fn main(args: Args) -> i32: the C main the compiler writes for it fills it from argc and argv, whose strings live as long as the process. Nothing else makes one, so every Args holds count readable entries, each a live NUL-terminated string.
Methods
method lensource
fn len(self) -> usize { ... }
The number of arguments, the program's name included.
method getsource
fn get(self, index: usize) -> Option[CStr] { ... }
Argument index as a C string, or None past the last one.
method bytessource
fn bytes(self, index: usize) -> Option[Str['static]] { ... }
The bytes of argument index, without its NUL. argv strings live as long as the process does, so the view is 'static.