pub struct CliParser<'a> { /* private fields */ }Implementations§
Source§impl<'a> CliParser<'a>
impl<'a> CliParser<'a>
pub fn new(spec: &'a CliSpec) -> Self
pub fn parse(&self, args: &RawArgs) -> Result<ParsedCli, CliError>
Sourcepub fn parse_with_env(
&self,
args: &RawArgs,
env: impl FnMut(&str) -> Option<OsString>,
) -> Result<ParsedCli, CliError>
pub fn parse_with_env( &self, args: &RawArgs, env: impl FnMut(&str) -> Option<OsString>, ) -> Result<ParsedCli, CliError>
Parses with an injected environment lookup; argv wins over env and defaults.
Sourcepub fn parse_os(&self, args: &RawOsArgs) -> Result<ParsedOsCli, CliError>
pub fn parse_os(&self, args: &RawOsArgs) -> Result<ParsedOsCli, CliError>
Preserves native path arguments and passthrough bytes without UTF-8 conversion.
Sourcepub fn parse_os_with_env(
&self,
args: &RawOsArgs,
env: impl FnMut(&str) -> Option<OsString>,
) -> Result<ParsedOsCli, CliError>
pub fn parse_os_with_env( &self, args: &RawOsArgs, env: impl FnMut(&str) -> Option<OsString>, ) -> Result<ParsedOsCli, CliError>
Native parser with deterministic environment injection for hosts and tests.
Auto Trait Implementations§
impl<'a> Freeze for CliParser<'a>
impl<'a> RefUnwindSafe for CliParser<'a>
impl<'a> Send for CliParser<'a>
impl<'a> Sync for CliParser<'a>
impl<'a> Unpin for CliParser<'a>
impl<'a> UnsafeUnpin for CliParser<'a>
impl<'a> UnwindSafe for CliParser<'a>
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