pub struct Args { /* private fields */ }
Expand description
Wrapper over C-style arguments
Implementations§
Source§impl Args
impl Args
Sourcepub unsafe fn new(
argc: isize,
argv: *const *const u8,
) -> Result<Self, (usize, Utf8Error)>
pub unsafe fn new( argc: isize, argv: *const *const u8, ) -> Result<Self, (usize, Utf8Error)>
Creates new instance, but verifies that each string inside are UTF-8.
On error returns pair: (string index, Utf8Error)
The function is safe as long as you pass C style main function arguments.
Sourcepub unsafe fn new_unchecked(argc: isize, argv: *const *const u8) -> Self
pub unsafe fn new_unchecked(argc: isize, argv: *const *const u8) -> Self
Unchecked version of Args::new
Do it on your own risk
Sourcepub unsafe fn get_str_by_index(&self, index: usize) -> &str
pub unsafe fn get_str_by_index(&self, index: usize) -> &str
Retrieves string by index.
No checks, 100% unsafe.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Args
impl<'a> IntoIterator for &'a Args
impl Copy 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 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