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