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
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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MemHistory
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MemHistory
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for MemHistory
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for MemHistory
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MemHistory
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for MemHistory
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>