term_model::ansi

Trait Handler

Source
pub trait Handler {
Show 54 methods // Provided methods fn set_title(&mut self, _: &str) { ... } fn set_cursor_style(&mut self, _: Option<CursorStyle>) { ... } fn input(&mut self, _c: char) { ... } fn goto(&mut self, _: Line, _: Column) { ... } fn goto_line(&mut self, _: Line) { ... } fn goto_col(&mut self, _: Column) { ... } fn insert_blank(&mut self, _: Column) { ... } fn move_up(&mut self, _: Line) { ... } fn move_down(&mut self, _: Line) { ... } fn identify_terminal<W: Write>(&mut self, _: &mut W) { ... } fn device_status<W: Write>(&mut self, _: &mut W, _: usize) { ... } fn move_forward(&mut self, _: Column) { ... } fn move_backward(&mut self, _: Column) { ... } fn move_down_and_cr(&mut self, _: Line) { ... } fn move_up_and_cr(&mut self, _: Line) { ... } fn put_tab(&mut self, _count: i64) { ... } fn backspace(&mut self) { ... } fn carriage_return(&mut self) { ... } fn linefeed(&mut self) { ... } fn bell(&mut self) { ... } fn substitute(&mut self) { ... } fn newline(&mut self) { ... } fn set_horizontal_tabstop(&mut self) { ... } fn scroll_up(&mut self, _: Line) { ... } fn scroll_down(&mut self, _: Line) { ... } fn insert_blank_lines(&mut self, _: Line) { ... } fn delete_lines(&mut self, _: Line) { ... } fn erase_chars(&mut self, _: Column) { ... } fn delete_chars(&mut self, _: Column) { ... } fn move_backward_tabs(&mut self, _count: i64) { ... } fn move_forward_tabs(&mut self, _count: i64) { ... } fn save_cursor_position(&mut self) { ... } fn restore_cursor_position(&mut self) { ... } fn clear_line(&mut self, _mode: LineClearMode) { ... } fn clear_screen(&mut self, _mode: ClearMode) { ... } fn clear_tabs(&mut self, _mode: TabulationClearMode) { ... } fn reset_state(&mut self) { ... } fn reverse_index(&mut self) { ... } fn terminal_attribute(&mut self, _attr: Attr) { ... } fn set_mode(&mut self, _mode: Mode) { ... } fn unset_mode(&mut self, _: Mode) { ... } fn set_scrolling_region(&mut self, _top: usize, _bottom: usize) { ... } fn set_keypad_application_mode(&mut self) { ... } fn unset_keypad_application_mode(&mut self) { ... } fn set_active_charset(&mut self, _: CharsetIndex) { ... } fn configure_charset(&mut self, _: CharsetIndex, _: StandardCharset) { ... } fn set_color(&mut self, _: usize, _: Rgb) { ... } fn dynamic_color_sequence<W: Write>(&mut self, _: &mut W, _: u8, _: usize) { ... } fn reset_color(&mut self, _: usize) { ... } fn set_clipboard(&mut self, _: u8, _: &[u8]) { ... } fn write_clipboard<W: Write>(&mut self, _: u8, _: &mut W) { ... } fn decaln(&mut self) { ... } fn push_title(&mut self) { ... } fn pop_title(&mut self) { ... }
}
Expand description

Type that handles actions from the parser

XXX Should probably not provide default impls for everything, but it makes writing specific handler impls for tests far easier.

Provided Methods§

Source

fn set_title(&mut self, _: &str)

OSC to set window title

Source

fn set_cursor_style(&mut self, _: Option<CursorStyle>)

Set the cursor style

Source

fn input(&mut self, _c: char)

A character to be displayed

Source

fn goto(&mut self, _: Line, _: Column)

Set cursor to position

Source

fn goto_line(&mut self, _: Line)

Set cursor to specific row

Source

fn goto_col(&mut self, _: Column)

Set cursor to specific column

Source

fn insert_blank(&mut self, _: Column)

Insert blank characters in current line starting from cursor

Source

fn move_up(&mut self, _: Line)

Move cursor up rows

Source

fn move_down(&mut self, _: Line)

Move cursor down rows

Source

fn identify_terminal<W: Write>(&mut self, _: &mut W)

Identify the terminal (should write back to the pty stream)

TODO this should probably return an io::Result

Source

fn device_status<W: Write>(&mut self, _: &mut W, _: usize)

Source

fn move_forward(&mut self, _: Column)

Move cursor forward cols

Source

fn move_backward(&mut self, _: Column)

Move cursor backward cols

Source

fn move_down_and_cr(&mut self, _: Line)

Move cursor down rows and set to column 1

Source

fn move_up_and_cr(&mut self, _: Line)

Move cursor up rows and set to column 1

Source

fn put_tab(&mut self, _count: i64)

Put count tabs

Source

fn backspace(&mut self)

Backspace count characters

Source

fn carriage_return(&mut self)

Carriage return

Source

fn linefeed(&mut self)

Linefeed

Source

fn bell(&mut self)

Ring the bell

Hopefully this is never implemented

Source

fn substitute(&mut self)

Substitute char under cursor

Source

fn newline(&mut self)

Newline

Source

fn set_horizontal_tabstop(&mut self)

Set current position as a tabstop

Source

fn scroll_up(&mut self, _: Line)

Scroll up rows rows

Source

fn scroll_down(&mut self, _: Line)

Scroll down rows rows

Source

fn insert_blank_lines(&mut self, _: Line)

Insert count blank lines

Source

fn delete_lines(&mut self, _: Line)

Delete count lines

Source

fn erase_chars(&mut self, _: Column)

Erase count chars in current line following cursor

Erase means resetting to the default state (default colors, no content, no mode flags)

Source

fn delete_chars(&mut self, _: Column)

Delete count chars

Deleting a character is like the delete key on the keyboard - everything to the right of the deleted things is shifted left.

Source

fn move_backward_tabs(&mut self, _count: i64)

Move backward count tabs

Source

fn move_forward_tabs(&mut self, _count: i64)

Move forward count tabs

Source

fn save_cursor_position(&mut self)

Save current cursor position

Source

fn restore_cursor_position(&mut self)

Restore cursor position

Source

fn clear_line(&mut self, _mode: LineClearMode)

Clear current line

Source

fn clear_screen(&mut self, _mode: ClearMode)

Clear screen

Source

fn clear_tabs(&mut self, _mode: TabulationClearMode)

Clear tab stops

Source

fn reset_state(&mut self)

Reset terminal state

Source

fn reverse_index(&mut self)

Reverse Index

Move the active position to the same horizontal position on the preceding line. If the active position is at the top margin, a scroll down is performed

Source

fn terminal_attribute(&mut self, _attr: Attr)

set a terminal attribute

Source

fn set_mode(&mut self, _mode: Mode)

Set mode

Source

fn unset_mode(&mut self, _: Mode)

Unset mode

Source

fn set_scrolling_region(&mut self, _top: usize, _bottom: usize)

DECSTBM - Set the terminal scrolling region

Source

fn set_keypad_application_mode(&mut self)

DECKPAM - Set keypad to applications mode (ESCape instead of digits)

Source

fn unset_keypad_application_mode(&mut self)

DECKPNM - Set keypad to numeric mode (digits instead of ESCape seq)

Source

fn set_active_charset(&mut self, _: CharsetIndex)

Set one of the graphic character sets, G0 to G3, as the active charset.

‘Invoke’ one of G0 to G3 in the GL area. Also referred to as shift in, shift out and locking shift depending on the set being activated

Source

fn configure_charset(&mut self, _: CharsetIndex, _: StandardCharset)

Assign a graphic character set to G0, G1, G2 or G3

‘Designate’ a graphic character set as one of G0 to G3, so that it can later be ‘invoked’ by set_active_charset

Source

fn set_color(&mut self, _: usize, _: Rgb)

Set an indexed color value

Source

fn dynamic_color_sequence<W: Write>(&mut self, _: &mut W, _: u8, _: usize)

Write a foreground/background color escape sequence with the current color

Source

fn reset_color(&mut self, _: usize)

Reset an indexed color to original value

Source

fn set_clipboard(&mut self, _: u8, _: &[u8])

Set the clipboard

Source

fn write_clipboard<W: Write>(&mut self, _: u8, _: &mut W)

Write clipboard data to child.

Source

fn decaln(&mut self)

Run the decaln routine.

Source

fn push_title(&mut self)

Push a title onto the stack

Source

fn pop_title(&mut self)

Pop the last title from the stack

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§