File: scroll.rs

package info (click to toggle)
rust-termion 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 268 kB
  • sloc: makefile: 2
file content (23 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Scrolling.

use std::fmt;

/// Scroll up.
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Up(pub u16);

impl fmt::Display for Up {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, csi!("{}S"), self.0)
    }
}

/// Scroll down.
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Down(pub u16);

impl fmt::Display for Down {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, csi!("{}T"), self.0)
    }
}