Struct rline::Readline

source ·
pub struct Readline { /* private fields */ }
Expand description

A struct representing a context for reading a line using libreadline.

Implementations§

Create a new Readline instance.

Panics

Panics on failure to allocate internally used C objects.

Feed a character to libreadline.

Reset libreadline’s line state to the given line with the given cursor position. If clear_undo is set, the undo list associated with the current line is cleared

Note that this method does not deal with input related modes. For example, libreadline always starts in input mode, but, depending on user configuration, it can be transitioned to vi-movement-mode in which key bindings behave differently (other similar modes exist). When reseting the line using this method the input mode is unaffected. If you truly need to manually force libreadline into input mode, a new Readline will help:

current = Readline::new();
Panics

Panics if the cursor is not less than or equal to the number of characters in the given line.

Inspect the current line state through a closure.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Executes the destructor for this type. 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.

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.