Struct MemHistory

struct MemHistory { ... }

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()].

impl Default for MemHistory

fn default() -> Self

impl Freeze for MemHistory

impl History for MemHistory

fn get(self: &Self, index: usize, _: SearchDirection) -> Result<Option<SearchResult<'_>>>
fn add(self: &mut Self, line: &str) -> Result<bool>
fn add_owned(self: &mut Self, line: String) -> Result<bool>
fn len(self: &Self) -> usize
fn is_empty(self: &Self) -> bool
fn set_max_len(self: &mut Self, len: usize) -> Result<()>
fn ignore_dups(self: &mut Self, yes: bool) -> Result<()>
fn ignore_space(self: &mut Self, yes: bool)
fn save(self: &mut Self, _: &Path) -> Result<()>
fn append(self: &mut Self, _: &Path) -> Result<()>
fn load(self: &mut Self, _: &Path) -> Result<()>
fn clear(self: &mut Self) -> Result<()>
fn search(self: &Self, term: &str, start: usize, dir: SearchDirection) -> Result<Option<SearchResult<'_>>>
fn starts_with(self: &Self, term: &str, start: usize, dir: SearchDirection) -> Result<Option<SearchResult<'_>>>

impl Index for MemHistory

fn index(self: &Self, index: usize) -> &String

impl RefUnwindSafe for MemHistory

impl Send for MemHistory

impl Sync for MemHistory

impl Unpin for MemHistory

impl UnwindSafe for MemHistory

impl<T> Any for MemHistory

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for MemHistory

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for MemHistory

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for MemHistory

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for MemHistory

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for MemHistory

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for MemHistory

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>