Trait term_model::ansi::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

Object Safety§

This trait is not object safe.

Implementors§