pub struct History { /* private fields */ }Expand description
Manages input history for the line editor.
Implementations§
Source§impl History
impl History
Sourcepub fn new(max_len: usize) -> Self
pub fn new(max_len: usize) -> Self
Creates a new history buffer with the specified maximum length.
Sourcepub fn add(&mut self, line: impl Into<BString>) -> bool
pub fn add(&mut self, line: impl Into<BString>) -> bool
Adds a new line to history, returning true if added (deduplicating adjacent
identical entries).
Sourcepub fn set_max_len(&mut self, max_len: usize)
pub fn set_max_len(&mut self, max_len: usize)
Sets the maximum number of history entries allowed, evicting oldest entries if needed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for History
impl RefUnwindSafe for History
impl Send for History
impl Sync for History
impl Unpin for History
impl UnsafeUnpin for History
impl UnwindSafe for History
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more