aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.rs
blob: 256eb5826edcff469daa9ee236efb62fc2548dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/// This trait is used with `Parser::process_cb` to handle extra escape
/// sequences that don't have an impact on the terminal screen directly.
pub trait Callbacks {
    /// This callback is called when the terminal requests an audible bell
    /// (typically with `^G`).
    fn audible_bell(&mut self, _: &mut crate::Screen) {}
    /// This callback is called when the terminal requests an visual bell
    /// (typically with `\eg`).
    fn visual_bell(&mut self, _: &mut crate::Screen) {}
    /// This callback is called when the terminal receives invalid input
    /// (such as an invalid UTF-8 character or an used control character).
    fn error(&mut self, _: &mut crate::Screen) {}
}