[−][src]Struct vt100::Screen
Represents the overall terminal state.
Methods
impl Screen
[src]
pub fn set_size(&mut self, rows: u16, cols: u16)
[src]
Resizes the terminal.
pub fn size(&self) -> (u16, u16)
[src]
Returns the current size of the terminal.
The return value will be (rows, cols).
pub fn contents(&self) -> String
[src]
Returns the text contents of the terminal.
This will not include any formatting information, and will be in plain text format.
pub fn rows(&self, start: u16, width: u16) -> impl Iterator<Item = String> + '_
[src]
Returns the text contents of the terminal by row, restricted to the given subset of columns.
This will not include any formatting information, and will be in plain text format.
Newlines will not be included.
pub fn contents_formatted(&self) -> Vec<u8>
[src]
Returns the formatted contents of the terminal.
Formatting information will be included inline as terminal escape codes. The result will be suitable for feeding directly to a raw terminal parser, and will result in the same visual output. Internal terminal modes (such as application keypad mode or alternate screen mode) will not be included here, but modes that affect the visible output (such as hidden cursor mode) will.
pub fn rows_formatted(
&self,
start: u16,
width: u16
) -> impl Iterator<Item = Vec<u8>> + '_
[src]
&self,
start: u16,
width: u16
) -> impl Iterator<Item = Vec<u8>> + '_
Returns the formatted contents of the terminal by row, restricted to the given subset of columns.
Formatting information will be included inline as terminal escape codes. The result will be suitable for feeding directly to a raw terminal parser, and will result in the same visual output. Internal terminal modes (such as application keypad mode or alternate screen mode) will not be included here.
CRLF at the end of lines will not be included.
pub fn contents_diff(&self, prev: &Self) -> Vec<u8>
[src]
Returns a terminal byte stream sufficient to turn the screen described
by prev
into the screen described by self
.
The result of rendering prev.contents_formatted()
followed by
self.contents_diff(prev)
should be equivalent to the result of
rendering self.contents_formatted()
. This is primarily useful when
you already have a terminal parser whose state is described by prev
,
since the diff will likely require less memory and cause less
flickering than redrawing the entire screen contents.
pub fn rows_diff<'a>(
&'a self,
prev: &'a Self,
start: u16,
width: u16
) -> impl Iterator<Item = Vec<u8>> + 'a
[src]
&'a self,
prev: &'a Self,
start: u16,
width: u16
) -> impl Iterator<Item = Vec<u8>> + 'a
Returns a sequence of terminal byte streams sufficient to turn the
subset of each row from prev
(as described by start
and width
)
into the corresponding row subset in self
.
You must handle the initial row positioning yourself - each row diff expects to start out positioned at the start of that row. Internal terminal modes (such as application keypad mode or alternate screen mode) will not be included here.
pub fn cell(&self, row: u16, col: u16) -> Option<&Cell>
[src]
Returns the Cell
object at the given location in the terminal, if it
exists.
pub fn cursor_position(&self) -> (u16, u16)
[src]
Returns the current cursor position of the terminal.
The return value will be (row, col).
pub fn title(&self) -> &str
[src]
Returns the terminal's window title.
pub fn icon_name(&self) -> &str
[src]
Returns the terminal's icon name.
pub fn check_audible_bell(&mut self) -> bool
[src]
Returns whether an audible bell has occurred since the last time this method was called.
pub fn check_visual_bell(&mut self) -> bool
[src]
Returns whether an visual bell has occurred since the last time this method was called.
pub fn application_keypad(&self) -> bool
[src]
Returns whether the terminal should be in application keypad mode.
pub fn application_cursor(&self) -> bool
[src]
Returns whether the terminal should be in application cursor mode.
pub fn hide_cursor(&self) -> bool
[src]
Returns whether the terminal should be in hide cursor mode.
pub fn bracketed_paste(&self) -> bool
[src]
Returns whether the terminal should be in bracketed paste mode.
pub fn mouse_protocol_mode(&self) -> MouseProtocolMode
[src]
Returns the currently active MouseProtocolMode
pub fn mouse_protocol_encoding(&self) -> MouseProtocolEncoding
[src]
Returns the currently active MouseProtocolEncoding
Trait Implementations
impl Clone for Screen
[src]
impl Debug for Screen
[src]
impl Perform for Screen
[src]
fn print(&mut self, c: char)
[src]
fn execute(&mut self, b: u8)
[src]
fn esc_dispatch(
&mut self,
_params: &[i64],
intermediates: &[u8],
_ignore: bool,
b: u8
)
[src]
&mut self,
_params: &[i64],
intermediates: &[u8],
_ignore: bool,
b: u8
)
fn csi_dispatch(
&mut self,
params: &[i64],
intermediates: &[u8],
_ignore: bool,
c: char
)
[src]
&mut self,
params: &[i64],
intermediates: &[u8],
_ignore: bool,
c: char
)
fn osc_dispatch(&mut self, params: &[&[u8]])
[src]
fn hook(&mut self, params: &[i64], intermediates: &[u8], _ignore: bool)
[src]
fn put(&mut self, _: u8)
[src]
fn unhook(&mut self)
[src]
Auto Trait Implementations
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnwindSafe for Screen
impl RefUnwindSafe for Screen
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,