Struct rustyline::line_buffer::LineBuffer[][src]

pub struct LineBuffer { /* fields omitted */ }
Expand description

Represent the current input (text and cursor position).

The methods do text manipulations or/and cursor movements.

Implementations

Create a new line buffer with the given maximum capacity.

Extracts a string slice containing the entire buffer.

Converts a buffer into a String without copying or allocating.

Current cursor position (byte position)

Set cursor position (byte position)

Returns the length of this buffer, in bytes.

Returns true if this buffer has a length of zero.

Set line content (buf) and cursor position (pos).

Returns the position of the character just after the current cursor position.

Insert the character ch at current cursor position and advance cursor position accordingly. Return None when maximum buffer size has been reached, true when the character has been appended to the end of the line.

Yank/paste text at current position. Return None when maximum buffer size has been reached or is empty, true when the character has been appended to the end of the line.

Delete previously yanked text and yank/paste text at current position.

Move cursor on the left.

Move cursor on the right.

Move cursor to the start of the buffer.

Move cursor to the end of the buffer.

Move cursor to the start of the line.

Move cursor to the end of the line.

Is cursor at the end of input (whitespaces after cursor is discarded)

Delete the character at the right of the cursor without altering the cursor position. Basically this is what happens with the “Delete” keyboard key. Return the number of characters deleted.

Delete the character at the left of the cursor. Basically that is what happens with the “Backspace” keyboard key.

Kill the text from point to the end of the line.

Kill the text from point to the end of the buffer.

Kill backward from point to the beginning of the line.

Kill backward from point to the beginning of the buffer.

Exchange the char before cursor with the character at cursor.

Moves the cursor to the beginning of previous word.

Delete the previous word, maintaining the cursor at the start of the current word.

Moves the cursor to the end of next word.

Moves the cursor to the same column in the line above

Moves the cursor to the same column in the line above

Move cursor to the matching character position. Return true when the search succeeds.

Kill from the cursor to the end of the current word, or, if between words, to the end of the next word.

Delete range specified by cs search.

Alter the next word.

Transpose two words

Replaces the content between [start..end] with text and positions the cursor to the end of text.

Insert the string at the specified position. Return true if the text has been inserted at the end of the line.

Remove the specified range in the line.

Return the content between current cursor position and mvt position. Return None when the buffer is empty or when the movement fails.

Kill range specified by mvt.

Indent range specified by mvt.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

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

Performs the conversion.

Performs the conversion.

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.