Module cargo_lambda_interactive::autocompletion
source · Expand description
Trait and structs used by prompts to provide autocompletion features.
Autocompleters receive the user input to a given prompt and may return a list of suggestions, selectable by the user as an option to be completed.
When the user presses the autocompletion hotkey (tab
by default) the
autocompleter receives the current text input and the currently highlighted
selection, if any. Then the developer may return a Replacement action
where the current user text input is replaced or not by a provided string.
Check the example files to see some usages, recommended are expense_tracker.rs
and complex_autocompletion.rs
.
Structs
Empty struct and implementation of Autocomplete trait. Used for the default
autocompleter of
Text
prompts.Traits
Mechanism to implement autocompletion features for text inputs. The
Autocomplete
trait has two provided methods: get_suggestions
and get_completion
.Type Definitions
Used when an autocompletion is triggered for the user’s text input.