Expand description
Readline for Rust
This implementation is based on Antirez’s Linenoise
§Example
Usage
let mut rl = rustyline::DefaultEditor::new()?;
let readline = rl.readline(">> ");
match readline {
Ok(line) => println!("Line: {:?}", line),
Err(_) => println!("No input"),
}
Re-exports§
pub use crate::config::Behavior;
pub use crate::config::ColorMode;
pub use crate::config::CompletionType;
pub use crate::config::Config;
pub use crate::config::EditMode;
pub use crate::config::HistoryDuplicates;
Modules§
- completion
- Completion API
- config
- Customize line editor
- error
- Contains error type for handling I/O and Errno errors
- highlight
- Syntax highlighting
- hint
- Hints (suggestions at the right of the prompt as you type).
- history
- History API
- line_
buffer - Line buffer with current cursor position
- validate
- Input validation API (Multi-line editing)
Structs§
- Changeset
- Undo manager
- Context
- Completion/suggestion context
- Editor
- Line editor
- Event
Context - Give access to user input.
- KeyEvent
- Input key pressed and modifiers
- Modifiers
- The set of modifier keys that were triggered along with a key press.
Enums§
- Anchor
- Where to paste (relative to cursor position)
- At
- Where to move with respect to word boundary
- Char
Search - character search
- Cmd
- Commands
- Event
- Input event
- Event
Handler - Event handler
- Input
Mode - Vi input modes
- KeyCode
- Input key pressed
- Movement
- Where to move
- Word
- Different word definitions
Traits§
- Conditional
Event Handler - May behave differently depending on:
- External
Printer - External printer
- Helper
- Syntax specific helper.
Type Aliases§
- Default
Editor - Default editor with no helper and
DefaultHistory
- Repeat
Count - The number of times one command should be repeated.
- Result
- The error type for I/O and Linux Syscalls (Errno)
Derive Macros§
- Completer
derive
- Helper
derive
- Highlighter
derive
- Hinter
derive
- Validator
derive