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§
sourcefn set_cursor_style(&mut self, _: Option<CursorStyle>)
fn set_cursor_style(&mut self, _: Option<CursorStyle>)
Set the cursor style
sourcefn insert_blank(&mut self, _: Column)
fn insert_blank(&mut self, _: Column)
Insert blank characters in current line starting from cursor
sourcefn identify_terminal<W: Write>(&mut self, _: &mut W)
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
fn device_status<W: Write>(&mut self, _: &mut W, _: usize)
sourcefn move_forward(&mut self, _: Column)
fn move_forward(&mut self, _: Column)
Move cursor forward cols
sourcefn move_backward(&mut self, _: Column)
fn move_backward(&mut self, _: Column)
Move cursor backward cols
sourcefn move_down_and_cr(&mut self, _: Line)
fn move_down_and_cr(&mut self, _: Line)
Move cursor down rows
and set to column 1
sourcefn move_up_and_cr(&mut self, _: Line)
fn move_up_and_cr(&mut self, _: Line)
Move cursor up rows
and set to column 1
sourcefn carriage_return(&mut self)
fn carriage_return(&mut self)
Carriage return
sourcefn substitute(&mut self)
fn substitute(&mut self)
Substitute char under cursor
sourcefn set_horizontal_tabstop(&mut self)
fn set_horizontal_tabstop(&mut self)
Set current position as a tabstop
sourcefn scroll_down(&mut self, _: Line)
fn scroll_down(&mut self, _: Line)
Scroll down rows
rows
sourcefn insert_blank_lines(&mut self, _: Line)
fn insert_blank_lines(&mut self, _: Line)
Insert count
blank lines
sourcefn delete_lines(&mut self, _: Line)
fn delete_lines(&mut self, _: Line)
Delete count
lines
sourcefn erase_chars(&mut self, _: Column)
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)
sourcefn delete_chars(&mut self, _: Column)
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.
sourcefn move_backward_tabs(&mut self, _count: i64)
fn move_backward_tabs(&mut self, _count: i64)
Move backward count
tabs
sourcefn move_forward_tabs(&mut self, _count: i64)
fn move_forward_tabs(&mut self, _count: i64)
Move forward count
tabs
sourcefn save_cursor_position(&mut self)
fn save_cursor_position(&mut self)
Save current cursor position
sourcefn restore_cursor_position(&mut self)
fn restore_cursor_position(&mut self)
Restore cursor position
sourcefn clear_line(&mut self, _mode: LineClearMode)
fn clear_line(&mut self, _mode: LineClearMode)
Clear current line
sourcefn clear_screen(&mut self, _mode: ClearMode)
fn clear_screen(&mut self, _mode: ClearMode)
Clear screen
sourcefn clear_tabs(&mut self, _mode: TabulationClearMode)
fn clear_tabs(&mut self, _mode: TabulationClearMode)
Clear tab stops
sourcefn reset_state(&mut self)
fn reset_state(&mut self)
Reset terminal state
sourcefn reverse_index(&mut self)
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
sourcefn terminal_attribute(&mut self, _attr: Attr)
fn terminal_attribute(&mut self, _attr: Attr)
set a terminal attribute
sourcefn unset_mode(&mut self, _: Mode)
fn unset_mode(&mut self, _: Mode)
Unset mode
sourcefn set_scrolling_region(&mut self, _top: usize, _bottom: usize)
fn set_scrolling_region(&mut self, _top: usize, _bottom: usize)
DECSTBM - Set the terminal scrolling region
sourcefn set_keypad_application_mode(&mut self)
fn set_keypad_application_mode(&mut self)
DECKPAM - Set keypad to applications mode (ESCape instead of digits)
sourcefn unset_keypad_application_mode(&mut self)
fn unset_keypad_application_mode(&mut self)
DECKPNM - Set keypad to numeric mode (digits instead of ESCape seq)
sourcefn set_active_charset(&mut self, _: CharsetIndex)
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
sourcefn configure_charset(&mut self, _: CharsetIndex, _: StandardCharset)
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
sourcefn dynamic_color_sequence<W: Write>(&mut self, _: &mut W, _: u8, _: usize)
fn dynamic_color_sequence<W: Write>(&mut self, _: &mut W, _: u8, _: usize)
Write a foreground/background color escape sequence with the current color
sourcefn reset_color(&mut self, _: usize)
fn reset_color(&mut self, _: usize)
Reset an indexed color to original value
sourcefn set_clipboard(&mut self, _: u8, _: &[u8])
fn set_clipboard(&mut self, _: u8, _: &[u8])
Set the clipboard
sourcefn write_clipboard<W: Write>(&mut self, _: u8, _: &mut W)
fn write_clipboard<W: Write>(&mut self, _: u8, _: &mut W)
Write clipboard data to child.
sourcefn push_title(&mut self)
fn push_title(&mut self)
Push a title onto the stack