pub struct TerminalIo { /* private fields */ }Expand description
A NarjuIo over a rustyline editor: highlighted, history-backed
line input on stdin, plain println! output.
Implementations§
Source§impl TerminalIo
impl TerminalIo
Sourcepub fn new() -> Result<Self, NarjuError>
pub fn new() -> Result<Self, NarjuError>
Construct the editor and load any existing history. Fails when
there is no usable terminal, which is why non-interactive
embeddings use HeadlessIo
instead.
Sourcepub fn save_history(&mut self)
pub fn save_history(&mut self)
Persist history to disk. Idempotent; safe to call multiple times. Errors are silently ignored — history loss isn’t worth panicking over.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TerminalIo
impl !RefUnwindSafe for TerminalIo
impl Send for TerminalIo
impl Sync for TerminalIo
impl Unpin for TerminalIo
impl !UnwindSafe for TerminalIo
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