Struct pomprt::Basic

source ·
pub struct Basic;
Expand description

A basic editor with no extra features

Trait Implementations§

source§

impl Editor for Basic

source§

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)

Inserts a character at the current cursor position, moving it forward 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 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 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

Auto 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> 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>,

§

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>,

§

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.