pub struct History { /* private fields */ }
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.

Save the history in the specified file.

Append new entries 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

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.