Struct Basic

Source
pub struct Basic;
Expand description

A basic editor with no extra features.

Trait Implementations§

Source§

impl Editor for Basic

Source§

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

Highlights the current prompt. Read more
Source§

fn hint(&self, buffer: &str) -> Option<String>

Returns a hint for the current input, if available. Read more
Source§

fn highlight_hint(&self, hint: &str) -> String

Highlights the current hint. Read more
Source§

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)

Inserts indentation at the current cursor position when Editor::complete returns none.
Source§

fn is_multiline(&self, buffer: &str, cursor: usize) -> bool

Returns true if the current input should be continued on another line.
Source§

fn is_keyword(c: char) -> bool

Returns true if the given character is a word character. Read more
Source§

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 next_event(&mut self, input: &mut Reader<impl Read>) -> Result<Event>

Reads ANSI sequences from input and returns an editor event. Read more

Auto Trait Implementations§

§

impl Freeze for Basic

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.