Struct rustyline::history::History[][src]

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

Current state of the history.

Implementations

Default constructor

Customized constructor with:

  • Config::max_history_size(),
  • Config::history_ignore_space(),
  • Config::history_duplicates().

Return the history entry at position index, starting from 0.

Return the last history entry (i.e. previous command)

Add a new entry in the history.

Return the number of entries in the history.

Return true if the history has no entry.

Set the maximum length for the history. This function can be called even if there is already some history, the function will make sure to retain just the latest len elements if the new history length value is smaller than the amount of items already inside the history.

Like [stifle_history](http://cnswww.cns.cwru. edu/php/chet/readline/history.html#IDX11).

Save the history in the specified file.

Load the history from the specified file.

Errors

Will return Err if path does not already exist or could not be read.

Clear history

Search history (start position inclusive [0, len-1]).

Return the absolute index of the nearest history entry that matches term.

Return None if no entry contains term between [start, len -1] for forward search or between [0, start] for reverse search.

Anchored search

Return a forward iterator.

Trait Implementations

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

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

Creates an iterator from a value. 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

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.