pub struct ShortcutResolver { /* private fields */ }Expand description
Command shortcut resolver
Implementations§
Source§impl ShortcutResolver
impl ShortcutResolver
Sourcepub fn index_specs(&mut self, specs: &BTreeMap<String, CachedSpec>)
pub fn index_specs(&mut self, specs: &BTreeMap<String, CachedSpec>)
Index all available commands for shortcut resolution
Sourcepub fn resolve_shortcut(&self, args: &[String]) -> ResolutionResult
pub fn resolve_shortcut(&self, args: &[String]) -> ResolutionResult
Resolve a command shortcut to full command path
§Panics
Panics if candidates is empty when exactly one match is expected. This should not happen in practice due to the length check.
Sourcepub fn format_ambiguous_suggestions(
&self,
matches: &[ResolvedShortcut],
) -> String
pub fn format_ambiguous_suggestions( &self, matches: &[ResolvedShortcut], ) -> String
Generate suggestions for ambiguous matches
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShortcutResolver
impl RefUnwindSafe for ShortcutResolver
impl Send for ShortcutResolver
impl Sync for ShortcutResolver
impl Unpin for ShortcutResolver
impl UnsafeUnpin for ShortcutResolver
impl UnwindSafe for ShortcutResolver
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