aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/display.rs
blob: 4868154c7d95bbf520a3cde0120f2b48693d3c06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use textmode::Textmode as _;

pub struct Display {}

impl Display {
    pub fn new() -> Self {
        Self {}
    }

    pub async fn render(
        &self,
        screen: &vt100::Screen,
        output: &mut textmode::Output,
    ) -> anyhow::Result<()> {
        output.clear();
        output.move_to(0, 0);
        output.write(&screen.contents_formatted());
        output.refresh().await?;
        Ok(())
    }
}