pub struct ForgivingParser { /* private fields */ }Expand description
Forgiving command parser with typo tolerance
Implementations§
Source§impl ForgivingParser
impl ForgivingParser
Sourcepub fn with_aliases(self, aliases: AliasRegistry) -> Self
pub fn with_aliases(self, aliases: AliasRegistry) -> Self
Create parser with custom alias registry
Sourcepub fn with_max_auto_correct_distance(self, distance: usize) -> Self
pub fn with_max_auto_correct_distance(self, distance: usize) -> Self
Set max auto-correct distance
Sourcepub fn with_max_suggestions(self, max: usize) -> Self
pub fn with_max_suggestions(self, max: usize) -> Self
Set max suggestions
Sourcepub fn add_commands(&mut self, commands: &[&str])
pub fn add_commands(&mut self, commands: &[&str])
Add additional known commands
Sourcepub fn parse(&self, input: &str) -> ParseResult
pub fn parse(&self, input: &str) -> ParseResult
Parse input with forgiving matching
Sourcepub fn known_commands(&self) -> &[String]
pub fn known_commands(&self) -> &[String]
Get all known commands
Sourcepub fn aliases(&self) -> &AliasRegistry
pub fn aliases(&self) -> &AliasRegistry
Get the alias registry
Trait Implementations§
Source§impl Debug for ForgivingParser
impl Debug for ForgivingParser
Auto Trait Implementations§
impl Freeze for ForgivingParser
impl RefUnwindSafe for ForgivingParser
impl Send for ForgivingParser
impl Sync for ForgivingParser
impl Unpin for ForgivingParser
impl UnsafeUnpin for ForgivingParser
impl UnwindSafe for ForgivingParser
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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