pub struct PromptHistory { /* private fields */ }Expand description
A persisted, searchable prompt history.
Implementations§
Source§impl PromptHistory
impl PromptHistory
Sourcepub fn new() -> PromptHistory
pub fn new() -> PromptHistory
An empty history (no file backing yet).
Sourcepub fn load_from_file(path: &Path) -> PromptHistory
pub fn load_from_file(path: &Path) -> PromptHistory
Load from path’s one-escaped-prompt-per-line format. A missing
file (first run) or an unreadable one is treated as “empty history”
rather than an error — losing prompt history is never worth
refusing to start the TUI over.
Sourcepub fn save_to_file(&self, path: &Path)
pub fn save_to_file(&self, path: &Path)
Persist to path (one escaped prompt per line, overwriting).
Best-effort: a write failure (e.g. a read-only config dir) is
silently dropped — the in-memory session history is unaffected
either way, matching crate::permissions::ApprovalCache::approve’s
“a lost write costs a feature, never a crash” precedent.
Trait Implementations§
Source§impl Clone for PromptHistory
impl Clone for PromptHistory
Source§fn clone(&self) -> PromptHistory
fn clone(&self) -> PromptHistory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptHistory
impl Debug for PromptHistory
Source§impl Default for PromptHistory
impl Default for PromptHistory
Source§fn default() -> PromptHistory
fn default() -> PromptHistory
Returns the “default value” for a type. Read more
impl Eq for PromptHistory
Source§impl PartialEq for PromptHistory
impl PartialEq for PromptHistory
impl StructuralPartialEq for PromptHistory
Auto Trait Implementations§
impl Freeze for PromptHistory
impl RefUnwindSafe for PromptHistory
impl Send for PromptHistory
impl Sync for PromptHistory
impl Unpin for PromptHistory
impl UnsafeUnpin for PromptHistory
impl UnwindSafe for PromptHistory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.