Struct liner::History
[−]
[src]
pub struct History { pub buffers: VecDeque<Buffer>, pub append_duplicate_entries: bool, // some fields omitted }
Structure encapsulating command history
Fields
buffers: VecDeque<Buffer>
Vector of buffers to store history in
append_duplicate_entries: bool
Methods
impl History
[src]
fn commit_history(&mut self)
[src]
It's important to execute this function before exiting your program, as it will ensure that all history data has been written to the disk.
fn new() -> History
[src]
Create new History structure.
fn len(&self) -> usize
[src]
Number of items in history.
fn push(&mut self, new_item: Buffer) -> Result<()>
[src]
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 get_newest_match<'a, 'b>(
&'a self,
curr_position: Option<usize>,
new_buff: &'b Buffer
) -> Option<&'a Buffer>
[src]
&'a self,
curr_position: Option<usize>,
new_buff: &'b Buffer
) -> Option<&'a Buffer>
Go through the history and try to find a buffer which starts the same as the new buffer given to this function as argument.
fn file_name(&self) -> Option<&str>
[src]
Get the history file name.
fn set_file_name(&mut self, name: Option<String>)
[src]
Set history file name. At the same time enable history.
fn set_max_size(&mut self, size: usize)
[src]
Set maximal number of buffers stored in memory
fn set_max_file_size(&mut self, size: usize)
[src]
Set maximal number of entries in history file
fn load_history(&mut self) -> Result<()>
[src]
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
[src]
Performs the indexing (container[index]
) operation.