Struct termsnap_lib::Term
source · pub struct Term<Ev: PtyWriter> { /* private fields */ }Expand description
An in-memory terminal emulator.
Implementations§
source§impl<W: PtyWriter> Term<W>
impl<W: PtyWriter> Term<W>
sourcepub fn new(lines: u16, columns: u16, pty_writer: W) -> Self
pub fn new(lines: u16, columns: u16, pty_writer: W) -> Self
Create a new emulated terminal with a cell matrix of lines by columns.
pty_writer is used to send output from the emulated terminal in reponse to ANSI requests.
Use VoidPtyWriter if you do not need to send responses to status requests.
sourcepub fn resize(&mut self, lines: u16, columns: u16)
pub fn resize(&mut self, lines: u16, columns: u16)
Resize the terminal screen to the specified dimension.
sourcepub fn current_screen(&self) -> Screen
pub fn current_screen(&self) -> Screen
Get a snapshot of the current terminal screen.
Auto Trait Implementations§
impl<Ev> !Freeze for Term<Ev>
impl<Ev> !RefUnwindSafe for Term<Ev>
impl<Ev> Send for Term<Ev>where
Ev: Send,
impl<Ev> !Sync for Term<Ev>
impl<Ev> Unpin for Term<Ev>where
Ev: Unpin,
impl<Ev> UnwindSafe for Term<Ev>where
Ev: UnwindSafe,
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