Struct MemHistory
pub struct MemHistory { /* private fields */ }
Transient in-memory history implementation.
Implementations
impl MemHistory
fn new() -> SelfDefault constructor
fn with_config(config: &Config) -> SelfCustomized constructor with:
- [
Config::max_history_size()], - [
Config::history_ignore_space()], - [
Config::history_duplicates()].
- [
Trait Implementations
impl Default for MemHistory
fn default() -> Self
impl History for MemHistory
fn get(&self, index: usize, SearchDirection) -> Result<Option<SearchResult<'_>>>fn add(&mut self, line: &str) -> Result<bool>fn add_owned(&mut self, line: String) -> Result<bool>fn len(&self) -> usizefn is_empty(&self) -> boolfn set_max_len(&mut self, len: usize) -> Result<()>fn ignore_dups(&mut self, yes: bool) -> Result<()>fn ignore_space(&mut self, yes: bool)fn save(&mut self, &Path) -> Result<()>fn append(&mut self, &Path) -> Result<()>fn load(&mut self, &Path) -> Result<()>fn clear(&mut self) -> Result<()>fn search(&self, term: &str, start: usize, dir: SearchDirection) -> Result<Option<SearchResult<'_>>>fn starts_with(&self, term: &str, start: usize, dir: SearchDirection) -> Result<Option<SearchResult<'_>>>
impl Index<usize> for MemHistory
type Output = String;fn index(&self, index: usize) -> &String