rustyline/hint.rs
1//! Hints (suggestions at the right of the prompt as you type).
2
3/// Hints provider
4pub trait Hinter {
5 /// Takes the currently edited `line` with the cursor `pos`ition and
6 /// returns the string that should be displayed or `None`
7 /// if no hint is available for the text the user currently typed.
8 fn hint(&self, line: &str, pos: usize) -> Option<String>;
9}
10
11impl Hinter for () {
12 fn hint(&self, _line: &str, _pos: usize) -> Option<String> {
13 None
14 }
15}