termion/
scroll.rs

1//! Scrolling.
2
3use std::fmt;
4
5/// Scroll up.
6#[derive(Copy, Clone, PartialEq, Eq)]
7pub struct Up(pub u16);
8
9impl fmt::Display for Up {
10    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11        write!(f, csi!("{}S"), self.0)
12    }
13}
14
15/// Scroll down.
16#[derive(Copy, Clone, PartialEq, Eq)]
17pub struct Down(pub u16);
18
19impl fmt::Display for Down {
20    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21        write!(f, csi!("{}T"), self.0)
22    }
23}