Struct terminal_cli::PromptBuffer
[−]
[src]
pub struct PromptBuffer { /* fields omitted */ }
Holds the current line buffer for a terminal and its possible autocomplete state.
Methods
impl PromptBuffer
[src]
fn new(options: PromptBufferOptions) -> PromptBuffer
[src]
Create a new prompt buffer
fn print_prompt<T: CharacterTerminalWriter>(&self, output: &mut T)
[src]
Print the prompt
fn handle_terminal_key<T, F: FnOnce(&mut CliExecutor)>(
&mut self,
terminal: &mut T,
call_commands: F
) -> Result<PromptEvent, TerminalError> where
T: CharacterTerminalWriter + CharacterTerminalReader + FmtWrite,
[src]
&mut self,
terminal: &mut T,
call_commands: F
) -> Result<PromptEvent, TerminalError> where
T: CharacterTerminalWriter + CharacterTerminalReader + FmtWrite,
Handle a single key from a terminal. Blocks until the terminal implementation returns a key.
fn handle_key<T, F: FnOnce(&mut CliExecutor)>(
&mut self,
key: Key,
terminal: &mut T,
call_commands: F
) -> PromptEvent where
T: CharacterTerminalWriter + FmtWrite,
[src]
&mut self,
key: Key,
terminal: &mut T,
call_commands: F
) -> PromptEvent where
T: CharacterTerminalWriter + FmtWrite,
Handle the incoming key press. Pass the lambda that will match the commands for autocomplete or execution.