Struct liner::History [] [src]

pub struct History {
    pub buffers: VecDeque<Buffer>,
    // some fields omitted
}

Structure encapsulating command history

Fields

buffers: VecDeque<Buffer>

Vector of buffers to store history in

Methods

impl History
[src]

fn new() -> History

Create new History structure.

fn len(&self) -> usize

Number of items in history.

fn push(&mut self, new_item: Buffer) -> Result<()>

Add a command to the history buffer and remove the oldest commands when the max history size has been met. If writing to the disk is enabled, this function will be used for logging history to the designated history file.

fn file_name(&self) -> Option<&str>

Get the history file name.

fn set_file_name(&mut self, name: Option<String>)

Set history file name. At the same time enable history.

fn set_max_size(&mut self, size: usize)

Set maximal number of buffers stored in memory

fn set_max_file_size(&mut self, size: usize)

Set maximal number of entries in history file

fn load_history(&mut self) -> Result<()>

Load history from given file name

Trait Implementations

impl Index<usize> for History
[src]

type Output = Buffer

The returned type after indexing

fn index(&self, index: usize) -> &Buffer

The method for the indexing (Foo[Bar]) operation

impl IndexMut<usize> for History
[src]

fn index_mut(&mut self, index: usize) -> &mut Buffer

The method for the indexing (Foo[Bar]) operation