pub struct CommandParser;Expand description
Command parser for splitting input into command and arguments
Implementations§
Source§impl CommandParser
impl CommandParser
Sourcepub fn parse<const MAX_ARGS: usize, const BUF_SIZE: usize>(
input: &str,
) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
pub fn parse<const MAX_ARGS: usize, const BUF_SIZE: usize>( input: &str, ) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
Parse a command line into command and arguments
Supports basic quote handling for arguments with spaces.
Sourcepub fn parse_simple<const MAX_ARGS: usize, const BUF_SIZE: usize>(
input: &str,
) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
pub fn parse_simple<const MAX_ARGS: usize, const BUF_SIZE: usize>( input: &str, ) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
Simple split on whitespace (faster but no quote support)
Sourcepub fn parse_max_split<const MAX_ARGS: usize, const BUF_SIZE: usize>(
input: &str,
max_splits: usize,
) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
pub fn parse_max_split<const MAX_ARGS: usize, const BUF_SIZE: usize>( input: &str, max_splits: usize, ) -> Result<ParsedCommand<MAX_ARGS, BUF_SIZE>, ParseError>
Parse with a maximum number of splits (remaining text goes into last arg)
Auto Trait Implementations§
impl Freeze for CommandParser
impl RefUnwindSafe for CommandParser
impl Send for CommandParser
impl Sync for CommandParser
impl Unpin for CommandParser
impl UnwindSafe for CommandParser
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