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

pub struct History { /* fields omitted */ }

Current state of the history.

Methods

impl History
[src]

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.

Returns the number of entries in the history.

Returns 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.

Save the history in the specified file.

Load the history from the specified file.

Failure

Will return Err if path does not already exist.

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.

Return a forward iterator.

Trait Implementations

impl Index<usize> for History
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'a> IntoIterator for &'a History
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more