pub struct CommandSearcher { /* private fields */ }Expand description
Command searcher for finding operations across APIs
Implementations§
Source§impl CommandSearcher
impl CommandSearcher
Sourcepub fn search(
&self,
specs: &BTreeMap<String, CachedSpec>,
query: &str,
api_filter: Option<&str>,
) -> Result<Vec<CommandSearchResult>, Error>
pub fn search( &self, specs: &BTreeMap<String, CachedSpec>, query: &str, api_filter: Option<&str>, ) -> Result<Vec<CommandSearchResult>, Error>
Search for commands across specifications
§Arguments
specs- Map of API context names to cached specificationsquery- The search query (keywords or regex)api_filter- Optional API context to limit search
§Returns
A vector of search results sorted by relevance
§Errors
Returns an error if regex compilation fails
Sourcepub fn find_similar_commands(
&self,
spec: &CachedSpec,
input: &str,
max_results: usize,
) -> Vec<(String, i64)>
pub fn find_similar_commands( &self, spec: &CachedSpec, input: &str, max_results: usize, ) -> Vec<(String, i64)>
Find similar commands to a given input
This is used for “did you mean?” suggestions on errors
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CommandSearcher
impl RefUnwindSafe for CommandSearcher
impl Send for CommandSearcher
impl Sync for CommandSearcher
impl Unpin for CommandSearcher
impl UnwindSafe for CommandSearcher
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