pub struct NopLineEditorHost { /* private fields */ }
Expand description

A concrete implementation of LineEditorHost that uses the default behaviors.

Trait Implementations

Returns the “default value” for a type. Read more

Returns the history implementation

Given a prompt string, return the rendered form of the prompt as a sequence of OutputElement instances. The implementation is free to interpret the prompt string however it chooses; for instance, the application can opt to expand its own application specific escape sequences as it sees fit. The OutputElement type allows returning graphic attribute changes as well as textual output. The default implementation returns the prompt as-is with no coloring and no textual transformation. Read more

Given a reference to the current line being edited, render a preview of its outcome. The preview is cleared when the input is accepted, or canceled. Read more

Given a reference to the current line being edited and the position of the cursor, return the rendered form of the line as a sequence of OutputElement instances. While this interface technically allows returning arbitrary Text sequences, the application should preserve the column positions of the graphemes, otherwise the terminal cursor position won’t match up to the correct location. The OutputElement type allows returning graphic attribute changes as well as textual output. The default implementation returns the line as-is with no coloring. Read more

Tab completion support. The line and current cursor position are provided and it is up to the embedding application to produce a list of completion candidates. The default implementation is an empty list. Read more

Allows the embedding application an opportunity to override or remap keys to alternative actions. Return None to indicate that the default keymap processing should occur. Otherwise return an Action enum variant indicating the action that should be taken. Use Some(Action::NoAction) to indicate that no action should be taken. editor is provided so that your application can implement custom actions and apply them to the editor buffer. Use LineEditor::get_line_and_cursor and LineEditor::set_line_and_cursor for that and return Some(Action::NoAction) to prevent any default action from being taken. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.