pub struct Mode { /* private fields */ }Expand description
Configuration for customizing the argument parsing behavior
§Examples
The default configuration disables all non-portable extensions:
let mode = Mode::default();
assert!(!mode.accepts_long_options());The with_extensions function returns a Mode
with those extensions enabled.
let mode = Mode::with_extensions();
assert!(mode.accepts_long_options());Implementations§
Source§impl Mode
impl Mode
Sourcepub const fn with_extensions() -> Self
pub const fn with_extensions() -> Self
Returns a new Mode with non-portable extensions enabled.
Sourcepub fn with_env<S>(env: &Env<S>) -> Self
pub fn with_env<S>(env: &Env<S>) -> Self
Convenience initializer
This function returns Self::default() or Self::with_extensions()
depending on env.options.get(PosixlyCorrect).
Sourcepub const fn accepts_long_options(&self) -> bool
pub const fn accepts_long_options(&self) -> bool
Whether the parser accepts long options or not
Sourcepub fn accept_long_options(&mut self, accept: bool) -> &mut Self
pub fn accept_long_options(&mut self, accept: bool) -> &mut Self
Sets whether the parser accepts long options or not.
Trait Implementations§
impl Copy for Mode
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more