pub struct Basic;
Expand description
A basic editor with no extra features
Trait Implementations§
source§impl Editor for Basic
impl Editor for Basic
source§fn next_event(&mut self, input: &mut Reader<impl Read>) -> Result<Event>
fn next_event(&mut self, input: &mut Reader<impl Read>) -> Result<Event>
Reads ANSI sequences from input and returns an editor event
source§fn insert(&self, buffer: &mut String, cursor: &mut usize, c: char)
fn insert(&self, buffer: &mut String, cursor: &mut usize, c: char)
Inserts a character at the current cursor position, moving it forward Read more
source§fn complete(&self, buffer: &str, cursor: usize) -> Option<Completion>
fn complete(&self, buffer: &str, cursor: usize) -> Option<Completion>
Provides completion if available Read more
source§fn indent(&self, buffer: &mut String, cursor: &mut usize)
fn indent(&self, buffer: &mut String, cursor: &mut usize)
Inserts indentation at the current cursor position when
Editor::complete
returns nonesource§fn highlight(&self, buffer: &str) -> String
fn highlight(&self, buffer: &str) -> String
Highlights the current input by adding ANSI color sequences Read more
source§fn highlight_prompt(&self, prompt: &str, multiline: bool) -> String
fn highlight_prompt(&self, prompt: &str, multiline: bool) -> String
Highlights the current prompt Read more
source§fn hint(&self, buffer: &str) -> Option<String>
fn hint(&self, buffer: &str) -> Option<String>
Returns a hint for the current input, if available Read more
source§fn is_multiline(&self, buffer: &str, cursor: usize) -> bool
fn is_multiline(&self, buffer: &str, cursor: usize) -> bool
Returns
true
if the current input should be continued on another linesource§fn is_keyword(c: char) -> bool
fn is_keyword(c: char) -> bool
Returns
true
if the given character is a word characterAuto Trait Implementations§
impl RefUnwindSafe for Basic
impl Send for Basic
impl Sync for Basic
impl Unpin for Basic
impl UnwindSafe for Basic
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