Struct MemHistory

pub struct MemHistory { /* private fields */ }

Transient in-memory history implementation.

Implementations

impl MemHistory

fn new() -> Self

Default constructor

fn with_config(config: &Config) -> Self

Customized 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) -> usize
fn is_empty(&self) -> bool
fn 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

Auto Trait Implementations

impl Freeze for MemHistory

impl RefUnwindSafe for MemHistory

impl Send for MemHistory

impl Sync for MemHistory

impl Unpin for MemHistory

impl UnsafeUnpin for MemHistory

impl UnwindSafe for MemHistory

Blanket Implementations

impl<T> Any for MemHistory where T: 'static + ?Sized,

impl<T> Borrow<T> for MemHistory where T: ?Sized,

impl<T> BorrowMut<T> for MemHistory where T: ?Sized,

impl<T> From<T> for MemHistory

impl<T, U> Into<U> for MemHistory where U: From<T>,

impl<T, U> TryFrom<U> for MemHistory where U: Into<T>,

impl<T, U> TryInto<U> for MemHistory where U: TryFrom<T>,