[][src]Struct vt100::Screen

pub struct Screen { /* fields omitted */ }

Represents the overall terminal state.

Methods

impl Screen[src]

pub fn size(&self) -> (u16, u16)[src]

Returns the current size of the terminal.

The return value will be (rows, cols).

pub fn scrollback(&self) -> usize[src]

Returns the current position in the scrollback.

This position indicates the offset from the top of the screen, and is 0 when the normal screen is in view.

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 visible 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.

pub fn rows_formatted(
    &self,
    start: u16,
    width: u16
) -> impl Iterator<Item = Vec<u8>> + '_
[src]

Returns the formatted visible 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.

You are responsible for positioning the cursor before printing each row, and the final cursor position after displaying each row is unspecified.

pub fn contents_diff(&self, prev: &Self) -> Vec<u8>[src]

Returns a terminal byte stream sufficient to turn the visible contents of the screen described by prev into the visible contents of 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]

Returns a sequence of terminal byte streams sufficient to turn the visible contents of the subset of each row from prev (as described by start and width) into the visible contents of the corresponding row subset in self.

You are responsible for positioning the cursor before printing each row, and the final cursor position after displaying each row is unspecified.

pub fn input_mode_formatted(&self) -> Vec<u8>[src]

Returns terminal escape sequences sufficient to set the current terminal's input modes.

Supported modes are:

  • application keypad
  • application cursor
  • bracketed paste
  • xterm mouse support

pub fn input_mode_diff(&self, prev: &Self) -> Vec<u8>[src]

Returns terminal escape sequences sufficient to change the previous terminal's input modes to the input modes enabled in the current terminal.

pub fn title_formatted(&self) -> Vec<u8>[src]

Returns terminal escape sequences sufficient to set the current terminal's window title.

pub fn title_diff(&self, prev: &Self) -> Vec<u8>[src]

Returns terminal escape sequences sufficient to change the previous terminal's window title to the window title set in the current terminal.

pub fn bells_diff(&self, prev: &Self) -> Vec<u8>[src]

Returns terminal escape sequences sufficient to cause audible and visual bells to occur if they have been received since the terminal described by prev.

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 audible_bell_count(&self) -> usize[src]

Returns a value which changes every time an audible bell is received.

Typically you would store this number after each call to process, and trigger an audible bell whenever it changes.

You shouldn't rely on the exact value returned here, since the exact value will not be maintained by contents_formatted or contents_diff.

pub fn visual_bell_count(&self) -> usize[src]

Returns a value which changes every time an visual bell is received.

Typically you would store this number after each call to process, and trigger an visual bell whenever it changes.

You shouldn't rely on the exact value returned here, since the exact value will not be maintained by contents_formatted or contents_diff.

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]

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]