pub struct History { /* private fields */ }Expand description
Prompt history per bucket, newest first.
Implementations§
Source§impl History
impl History
pub fn get(&self, bucket: &str) -> &[String]
Sourcepub fn push(&mut self, bucket: &'static str, entry: &str)
pub fn push(&mut self, bucket: &'static str, entry: &str)
Remember an answer: newest first, no duplicates, 100 deep.
Sourcepub fn load(&mut self, path: &Path)
pub fn load(&mut self, path: &Path)
Load persisted history: bucket\tentry lines, newest first
within each bucket, as History::save wrote them. Unknown
buckets are dropped.
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